Blog Detail
New features added to Java 5
http://learnjava5.blogspot.com/
This site provides features added to Java 5 like Autoboxing, var args, static imports,Generics, scanners and many other useful features
Recent Posts
Generics in Java 5
Arrays in Java have always been type safe. For example, an array declared as type integer can only accept integers (not String, Dog, Cat). But, collections are not like that. There is no syntax for declaring type safe collections in pre java 5. To cr...
Enums in Java 5
Following are the advantages of using Enums:Enums are type safe.Enums are Serializable and Comparable by defaultProgrammers doesn’t require to do extra work of implementing toString(), equals() and hashCode(). Enums provide implementation of these ...
Static Imports in Java 5
One reason of introducing static imports in java is to reduce keystrokes. Although, this is not the only reason, static imports are used when you want to use static members of a class. For example, if you want to use static fields and methods of Math...
Scanners in Java 5
Java.util.Scanner class in java 5 is mainly used for tokenizing data and finding stuff. Although, Scanners in java 5 doesn’t provide location information or search and replace functionality, it can be used to source data by applying regular express...
printf() method in Java 5
The format() and printf() methods were added to java.io.PrintStream with java 5. Syntax of printf() method in java 5:printf("format string", argument (s));The point to remember here is that, formatting data will always start with a percent sign (%). ...
Var-Args in Java 5
Java 5 allows methods to take variable number of argumentsPre Java 5 Examplevoid doSomething(int i, int j){ Save as Draft}This method will be called as follows:doSomething(10, 20);Using Java 5, you can declare doSomething method by giving variable ar...

