Local and Anonymous Inner Classes

Inner Classes are the classes which are declared inside an outer class i.e classes nesting with in outer class. They can be either static or non static. Static Inner classes are also called as Nested Classes. Inner classes come in Four flavors namely:

1. Static Member Classes
2. Member Classes
3. Local Classes
4. Anonymous classes

Read more

Book Review: Head First Java

Book: Head First Java (Website) Authors: Kathy Sierra, Bert Bates There are many people around aspiring to learn Java- One of the most powerful OO Languages. But Alas!!!! how to go about the learning process??? Which book is suited for my style of learning??? All these questions pop in one’s mind. Even they were my … Read more

Interface Vs Abstract Class

There are three differences between an interface and an abstract class: you can implement multiple interfaces at the same time, but only extend one class, an abstract class is allowed to contain implementation (non-abstract methods, constructors, instance initializers and instance variables) and non-public members, and abstract classes may be a tiny bit faster (or they … Read more

Call By Reference and Call By Value

Java always makes a copy of the argument and passes the copy. The called method has a local copy of the data. If the method changes the data it changes the copy, so the original value is not changed. When we pass a primitive like int this make perfect sense. The method gets its own … Read more

Overriding v/s Hiding

Many people have heard that you can’t override a static method. This is true – you can’t. However it is possible to write code like this: class Foo { public static void method() { System.out.println(“in Foo”); } } class Bar extends Foo { public static void method() { System.out.println(“in Bar”); } } This compiles and … Read more

Java Technology: Part-1

Java Technology: Java technology is both a high-level, object-oriented programming language and a platform. Java technology is based on the concept of a single Java Virtual Machine (JVM) — a translator between the language and the underlying software and hardware. All implementations of the programming language must emulate the JVM, enabling Java programs to run … Read more

Java Programming Style Guide

Introduction The Java language gives you all the room you need to write code that would be very difficult for others to understand. Java also permits you to write code that is very easy to understand. Most development teams would prefer the latter. A style guide provides provides a map so that the code generated … Read more