Some new features in JDK which maybe quite useful...
1. Generic Types
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0, new Integer(42));
int total = list.get(0).intValue();
2. Formatted output
System.out.printf("%s %5d%n", user,total);
3. New loops
ArrayList<Integer> list = new ArrayList<Integer>();
for (Iterator i = list.iterator(); i.hasNext();) {
Integer value=(Integer)i.next();
}
4. variable number of arguments
for (int i=0;i <args.length; i++) {
}
}
argtest("test", "data");
5. AWT/Swing
AWT
Version 5.0 features many AWT enhancements and bug fixes, including some that have often been requested by our customers. Most notably, the newMouseInfo
class makes it possible to determine the mouse location on the desktop. New Window
methods make it possible to specify the default location for a newly created window (or frame), appropriate to the platform. Another Window
enhancement makes it possible to ensure that a window (or frame) is always on top. (This feature does not work for some window managers on Solaris/Linux.) In the area of data transfer, the new DropTargetDragEvent
API allows the drop target to access transfer data during the drag operation.