answersLogoWhite

0

The new language features all have one thing in common: they take some common idiom and provide linguistic support for it.

In other words, they shift the responsibility for writing the boilerplate code from the programmer to the compiler. Because the source code is now free of this boilerplate, it's easier to write and read.

Because the compiler, unlike the programmer, never makes mistakes, the resulting code is also more likely to be free of bugs.

The following are the features added to jdk 1.5

# Generics - Provides compile-time type safety for collections and eliminates the drudgery of casting. Eg: you used to write (jdk 1.4)

List words = new ArrayList();

You'll have to say: (jdk 1.5)

List words = new ArrayList();

# Enhanced for loop - Eliminates the drudgery and error-proneness of iterators.

# Autoboxing/unboxing - Eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer).

# Typesafe enums - Provides all the well-known benefits of the Typesafe Enum pattern (Effective Java, Item 21) without the verbosity and the error-proneness.

# Static import - Lets you avoid qualifying static members with class names, without the shortcomings of the Constant Interface antipattern (Effective Java, Item 17).

# Metadata - Lets you avoid writing boilerplate code, by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it.

Regards:

Kavitha N Yadav

(Java Developer)

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is difference between as on and as at?

difference between as on and as at


What are the differences between California and Florida?

What is the difference between Florida and California What is the difference between Florida and California


What is the difference between physician and doctor?

what's the difference between physician and doctorwhat's the difference between physician and doctor what's the difference between physician and doctor


What difference between paging?

Difference between paging and what?


What is the difference between difference and difference?

The answer of difference


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd.?

difference between enterprise and corporation


What is the difference between a samurai and shogun?

The difference between a shogun and a samurai is like the difference between a king and a knight.


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd?

difference between enterprise and corporation


What is the difference between the 1993 Honda accord?

Difference between it and what?


What is the difference between polyethylene and polyester?

what is the main difference between polyethylene and polyesters what is the main difference between polyethylene and polyesters


What is the difference between disneyworld and Disneyland?

The difference between Disneyland and Disneyworld is that Disneyland is in California and Florida is in Disneyworld. This is the difference between Disneyland and Disneyworld.


How is the distance between two rational numbers related to their difference?

Directly. Their difference IS the difference between them.