L
Le Tubs
Hi
I'm relatively new to Java (from a C/C++ background, so please don't
flame me). I having trouble with some warnings like (the code compiles
_but_ I treat warnings as errors).
[javac] Compiling 10 source files to D:\class
[javac] xxxx\Oracle.java:294: warning: [unchecked] unchecked
[javac] found : java.util.Iterator
[javac] required: java.util.Iterator<java.lang.String>
[javac] Iterator<String> it =
this.hashmap.keySet().iterator();
The Code that generating it is below
Now I've gone out onto the www and a quite extensive search and sort of
getting quite confused about the whole issue. Can somebody shed some
light on what I am missing.
Thanking you in advance for your time and consideration.
Thanks
David
TreeMap hashmap;
public ArrayList getSortedKeys()
{
ArrayList<String> keys = new ArrayList<String>();
Iterator<String> it = this.hashmap.keySet().iterator();
while (it.hasNext())
{
keys.add( (String)it.next() );
}
return keys;
}
I'm relatively new to Java (from a C/C++ background, so please don't
flame me). I having trouble with some warnings like (the code compiles
_but_ I treat warnings as errors).
[javac] Compiling 10 source files to D:\class
[javac] xxxx\Oracle.java:294: warning: [unchecked] unchecked
[javac] found : java.util.Iterator
[javac] required: java.util.Iterator<java.lang.String>
[javac] Iterator<String> it =
this.hashmap.keySet().iterator();
The Code that generating it is below
Now I've gone out onto the www and a quite extensive search and sort of
getting quite confused about the whole issue. Can somebody shed some
light on what I am missing.
Thanking you in advance for your time and consideration.
Thanks
David
TreeMap hashmap;
public ArrayList getSortedKeys()
{
ArrayList<String> keys = new ArrayList<String>();
Iterator<String> it = this.hashmap.keySet().iterator();
while (it.hasNext())
{
keys.add( (String)it.next() );
}
return keys;
}