Java features explained with examples

Monthly archives for January, 2016

Inside a class file

In this post, we will explore the inner parts of a class file going byte by byte!!   The class file format is defined at It says: Each class file contains the definition of a single class or interface. I will add that the class may be public or package-private. For instance, it is possible to […]

Overloading by return type

It is known that one of the limitations of Java is the inability to overload a method by return type as the return type is not part of the signature of the method. According to, “Two methods or constructors, M and N, have the same signature if they have the same name, the same […]

Generics erasure

The use of Generics allows a type or method to operate on objects of different types while providing compile-time type safety. However, the JVM knows nothing about type parameters or generics as the compiler erases type parameters when creating bytecode. According to, type erasure aim is “Type erasure ensures that no new classes are created […]