http://paulmcpd.blogspot.com/2009/02/java-classpath.html
http://paulmcpd.blogspot.com/2009/02/another-jar-example.html
http://paulmcpd.blogspot.com/2009/09/scjp-errata.html
Sunday, September 13, 2009
Saturday, September 12, 2009
Friday, September 11, 2009
Java SCJP: How to do reverseOrder
Saturday, September 5, 2009
SCJP Errata
Thursday, September 3, 2009
Maps : How to get EntrySet
Below is an example of how to use Map.EntrySet
class MapTest{
private Map m = new HashMap();
public MapTest(){
m.put("a",1);
m.put("b",2);
m.put("c",3);
}
public void outputMap(){
for(Map.Entry e : m.entrySet()){
System.out.println(e.getKey() + " " + e.getValue());
}
}
}
call it from public static void main as follows:
new MapTest( ).outputMap( )
class MapTest{
private Map
public MapTest(){
m.put("a",1);
m.put("b",2);
m.put("c",3);
}
public void outputMap(){
for(Map.Entry
System.out.println(e.getKey() + " " + e.getValue());
}
}
}
call it from public static void main as follows:
new MapTest( ).outputMap( )
Subscribe to:
Posts (Atom)