2009 July | DeepakGaikwad.net - Part 2
Home » Archive

Articles Archive for July 2009

Headline »

[8 Jul 2009 | No Comment | ]

If you are a Maven user then you must know that you need a Java installed to run Maven. It requires the Java home being set up in environment variables before executing any Maven command. As Java has advanced through Java 5, Java 6 and waiting for Java 7, it is expected that all frameworks dependent on Java should also advance the compatibility. Maven’s new version – 2.2.0 is in line with this principle. It has offered compatibility with Java 1.5 (Java 5) and later but also it has removed …

Java, Tech Notes »

[6 Jul 2009 | No Comment | ]

Autoboxing feature in Java 5 is to make code look neater and cleaner. Autoboxing, as name suggests, does something automatically. It converts data types from one form to other automatically. This does not apply to any data type but to some selected data types which allow this conversion (generally without losing out any information). Using autoboxing, primitive data type values can be converted into respective wrapper objects and vice versa. Take a look at some of the data types that can avail this feature of autoboxing.

int <– –> Integer
boolean <– …

Java, Tech Notes »

[3 Jul 2009 | 2 Comments | ]

Compared to other changes in Java 5, this is a smaller change. The idea behind this change is to improve how we access collection elements and arrays. In this article, we see how the loop has improved over a period of time through different releases of Java. What are the advantages we get with new for loop? When is it not recommended to use this loop?
Let us see the ugly code to traverse through a collection. You must have written such a code by mistake in very early releases of …

Headline »

[2 Jul 2009 | No Comment | ]

Spring framework used dependency injection (DI) principle (also called as inversion of control) to provide a container that can offers many services to Java applications. Not only services but it also integrates AOP framework, Database access frameworks to ease a programmer’s life. The popularity of this framework made Sun to re-look at its Java technology stack to make coding easy. Impact of this framework can be easily seen on Java 5 release, where we can see drastic change in EJB framework. Annotations used to inject objects are also result of …

Java, Tech Notes »

[2 Jul 2009 | 5 Comments | ]

Generics, is an important feature introduced in Java 5. Java introduced many other features, but this is the only feature which adds flexibility to strongly type data types. In this article, we try to find answers to these questions: Why do we need this feature? What is this feature? What are different scenarios in usage of Generics? When can we not use Generics? Wherever applicable we take a code example and understand the concept better. Reader of this article should already know the concepts of Java version prior to this …