Listing 4

Listing 4 shows that ArrayList extends AbstractList. Have a look at Figure 1 and the entire thing will be clear.

Figure 1

As shown in Figure 1 above the new implementation of the ArrayList makes all the difference. And provides the

enhanced things. New ArrayList class implements the methods from the List interface and as List extends Iterable, every ArrayList is an Iterable. (See Figure 1)

So when we write new for loop, compiler automatically generates a necessary looping code and with the help of generics the additional efforts required for casting (As shown in Listing 1 above) are eliminated.

This shows that the new enhanced for loop provides a hassle free solution for data manipulation.

Auto-Boxing/Unboxing

Auto-boxing/Unboxing is a small but important feature introduced in J2SE 5.0.

Auto-boxing/Unboxing is a clean and easy approach to converting primitive data types to their respective wrapper classes.

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!