Blog Detail

New features added to Java 5

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

subscribe Recent Posts

  • Generics in Java 5

    Posted on Saturday July 18th, 2009 at 08:30

    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

    Posted on Thursday July 16th, 2009 at 10:20

    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

    Posted on Tuesday July 14th, 2009 at 10:30

    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

    Posted on Monday July 13th, 2009 at 11:32

    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

    Posted on Sunday July 12th, 2009 at 09:05 in formatting with printf() and format() in java

    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

    Posted on Sunday February 8th, 2009 at 03:03 in 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...

Comments & Reviews

There is no rating for this blog because there are no comments yet.

Post A Comment/Review

* Your IP is being logged.
* Your e-mail address is used only for verification purposes only and will not be sold, or shown publicly.
* No HTML tags allowed
* DO NOT use the Comments/Reviews to promote your own site.

Name: or Login
E-mail:
Rating:
Verify: Spam Protection: sum of 2 + 3
Comment:
  Remember Information