|
-
July 8th, 2002, 10:25 AM
#1
question about the Enumeration interface
I'm quite new in Java programming and I have a question related
to the Enumeration interface.
I wrote a little application which extracts the system parameters
and displays them. It is working and the code looks like this:
Properties systemProperties = System.getProperties(); Enumeration enum = systemProperties.propertyNames();
String key,value;
System.out.println("VM SYSTEM PROPERTIES");
while(enum.hasMoreElements())
{
key = (String)enum.nextElement();
value = systemProperties.getProperty(key);
System.out.println(key+" = "+value);
} // end while
The code is working fine. But however I do not understand why I can use the Enumeration object (returned by the propertyNames()
function, since Enumeration is a INTERFACE and seem to be implemented by the class Properties.
10x in advance for u're answer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|