Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting system properties 1

Status
Not open for further replies.

mscano

Programmer
Aug 23, 2006
1
0
0
US
I am interested in knowing how to sort a Properties object. When compiling the following lines of code:

Map prop = System.getProperties();
TreeMap tm = new TreeMap(prop);

I get the following error:

Note: E:\Java\src\PropertiesExample.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Please advise.


 
Its just the 1.5 compiler warning you about using a possibly non-safe object type. Theres nothing actually wrong with the code - its just that in 1.5 Java introduced "Generics" - or templates in C++ - and its just a warning about that.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top