PDA

View Full Version : New Features in JAVA 1.5


javaguru
16-01-2010, 09:00 AM
These are some new features of JAVA 1.5

Generics (http://developer.java.sun.com/developer/technicalArticles/releases/generics/)
Autoboxing (http://jcp.org/aboutJava/communityprocess/jsr/tiger/autoboxing.html)
Enhanced For-loop (http://jcp.org/aboutJava/communityprocess/jsr/tiger/enhanced-for.html)
Enumerations (http://jcp.org/aboutJava/communityprocess/jsr/tiger/enum.html)
Static Imports (http://jcp.org/aboutJava/communityprocess/jsr/tiger/static-import.html)

javaguru
16-01-2010, 09:03 AM
Generics
Generics provide a way to create and use type-safe data structures. It means every time when we create e.g. List we don’t need to typecast value when we want to use them. Safer and easier!

Foreach loops
Every object implementing Iterable or arrays can be used now in shortened form of for() statement. We can now easily go through iterable object just defining variable type and name and what I would like to iterate through.

Autoboxing/Unboxing
Each primitive type in Java has got its object-based counterpart. Before it wasn’t possible to mix these so when primitive int was expected it wasn’t possible to use Integer object instead. We needed to transform values there and back all the time - it’s not needed any more - Java will handle it for us.

Enumerated types
Before we needed to use (usually) static final integer constants to in form like: CARD_TYPE_VISA = 1; CARD_TYPE_MAESTRO = 2. Now Java introduced enum types. There are really powerful and much useful. Biggest advantage is that ‘enum’ bugs are now caught at compile time and not at runtime. They can even use methods to enhance their usability.

Static imports
The static import feature, implemented as “import static”, enables you to refer to static constants from a class without needing to inherit from it. Instead of BorderLayout.CENTEReach time we add a component, we can simply refer to CENTER.

Formatted input/output
Now we can use formatted printf-type functionality to read/write to console or any other data stream. There was %n cross-platform new-line char introduced.

Varargs
Multiple arguments is possible to pass to method from this release. It is easy as type ‘Object … args’ as method parameter.

Metadata
The metadata feature provides the ability to associate additional data to classes, interfaces, methods, and fields. These can be then read by Java compiler or other tools or used at runtime by Java reflection API. A tool could use the metadata information to generate additional source code, or to provide additional information when debugging.

Desktop client
There are some improvements in startup time and memory usage. With Swing package comes some new look-and-fells and JTable printing support.

sunita
18-03-2010, 07:24 AM
Can you please point out what are the new features in JAVA 1.6?

Sanket
19-03-2010, 06:38 AM
You can check this link..

http://java.sun.com/javase/6/webnotes/features.html for new features and enhancements in Java 6.

sachinjoshi
21-03-2010, 06:17 AM
thanks, I was looking for this information.

varun
03-04-2010, 07:17 AM
I have heard somewhere that java 1.7 is also coming. Any idea by what time will it be released?

surya
06-04-2010, 11:41 PM
You can visit https://jdk7.dev.java.net/ for latest updates on Java 1.7.

sony
10-04-2010, 07:01 PM
You can visit https://jdk7.dev.java.net/ for latest updates on Java 1.7.

This is a great news. How java 1.7 is different from its previous versions?

abhishek
06-07-2010, 07:33 AM
You can visit https://jdk7.dev.java.net/ for latest updates on Java 1.7.

Thanks for sharing updated on Java 1.7.

jitendragarg
06-07-2010, 09:24 AM
Too many java developers here. BTW, any ideas where is .net developers of this forum? Seeing hardly any new info from their side. or is it that everyone switched to Java?

Anyways something for my java developer friends. Enjoy!!

KrfpnbGXL70

jhonybush
28-08-2010, 10:25 PM
The new features in Java are Generics, Enhanced for Loop, Autoboxing/Unboxing, Typesafe Enums, Varargs, Static Import, Metadata etc.

jameserics
15-10-2010, 04:45 PM
Yes I agree to that. I am completely fit as per your requirement and capable of doing the task as per your requirement. I like your tips and it is very useful for me and for other people.