Archive for July, 2009

Decorative Programming using Annotations

Annotation is not a new feature getting introduced in Java 5, but in this release Java is trying to explore the power of this feature. If we look at the open source product stack adapting to Java 5, then this is the feature what has changed most of the products considerably. It has begun a [...]

Java, Tech Notes

Faster Dynamically Typed Languages on JVM 7

Before going into what Java is offering in this new release, let us understand what dynamically typed languages are. Examples are Javascript, Ruby, Python, Groovy and so on. Few details of these languages -

Common feature is an ability to modify classes at runtime to allow implementation of new interfaces. The name is dynamically typed [...]

Headline

Static Imports in Java 5

Static keyword is used to allow access to an attribute/ a method or a class without creating instance of it. (Some of you may argue that this is not object oriented way, but we leave that discussion aside for now.) We use static for those elements which do not change from instance to instance of [...]

Java, Tech Notes

Varargs in Java 5

Varargs means variable arguments, something really different from normal Java language syntax. Normally, we define method signature to offer a contract to the callers of that method by restricting number and type of input parameters, return data type and exceptions thrown. Using vararg feature, we can overcome this restriction partially and make the signature dynamic. [...]

Java, Tech Notes

Enums in Java 5 with Code Examples

Enumerations already existed in other languages like C, C++, SmallTalk etc. Enums are used primarily to handle a collection of logically grouped constants. In Java, for ages we have been handling constants (number constants here) through separate Java files, sometimes by encapsulating those in relevant POJOs, and even using a wrong design style of implementing [...]

Java, Tech Notes

Maven Leaves Java 1.4 Back

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 [...]

Headline

Autoboxing in Java 5

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 [...]

Java, Tech Notes

For Each Loop in Java 5

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 [...]

Java, Tech Notes

Spring Python Released

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 [...]

Headline

Generics in Java 5 Explained

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 [...]

Java, Tech Notes