what is features of jdk 1.5?

Answer Posted / sivasubramanian.k

(1)Generics:Provides compile-time (static) type safety for
collections and eliminates the need for most typecasts
(type conversion). (Specified by JSR 14.)

(2)Metadata: Also called annotations, allows language
constructs such as classes and methods to be tagged with
additional data, which can then be processed by metadata-
aware utilities. (Specified by JSR 175.)

(3)Autoboxing/unboxing: Automatic conversions between
primitive types (such as int) and primitive wrapper classes
(such as Integer). (Specified by JSR 201.)

(4)Enumerations: The enum keyword creates a typesafe,
ordered list of values (such as Day.MONDAY, Day.TUESDAY,
etc.). Previously this could only be achieved by non-
typesafe constant integers or manually constructed classes
(typesafe enum pattern). (Specified by JSR 201.)

(5)Swing: New skinnable look and feel, called synth.
Varargs: The last parameter of a method can now be declared
using a type name followed by three dots (e.g. void drawtext
(String... lines)). In the calling code any number of
parameters of that type can be used and they are then
placed in an array to be passed to the method, or
alternatively the calling code can pass an array of that
type.

(5)Enhanced 'for loop': The for loop syntax is extended
with special syntax for iterating over each member of
either an array or any Iterable..

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can list be final in java?

489


What is import java util arraylist?

661


What is an empty class? What functionality does it offer in Java?

677


What are the files generated after using IDL to java compiler?

590


What is variable and its types?

546






Can we rethrow the same exception from catch handler?

566


What are the pillars of java?

489


Explain java heap space and garbage collection?

587


Can arraylist hold different types java?

484


What is nested top-level class?

580


State some advantages of java?

717


Write a java program that prints all the values given at command-line.

558


Why generics are used in java?

553


what is the significance of listiterator in java?

624


Is java still relevant?

500