Category Archives

Java is Strictly Pass by Value!

Consider the following Java program that passes a primitive type to function. public class Main { public static void...

Java is Strictly Pass by Value!

Consider the following Java program that passes a primitive type to function. public class Main { public static void...

Private and final methods in Java

When we use final specifier with a method, the method cannot be overridden in any of the inheriting classes....

Private and final methods in Java

When we use final specifier with a method, the method cannot be overridden in any of the inheriting classes....

Overloading main() in Java

Consider the below Java program. // A Java program with overloaded main() import java.io.*; public class Test { //...

Overloading main() in Java

Consider the below Java program. // A Java program with overloaded main() import java.io.*; public class Test { //...

Method Overloading and Ambiguity in Varargs in Java

Method Overloading in Varargs Overloading allows different methods to have same name, but different signatures where signature can differ...

Method Overloading and Ambiguity in Varargs in Java

Method Overloading in Varargs Overloading allows different methods to have same name, but different signatures where signature can differ...

Method Overloading with Autoboxing and Widening in Java

In Java there are two type of variables: Primitive type and Reference type. Conversion of primitive type to its...

Method Overloading with Autoboxing and Widening in Java

In Java there are two type of variables: Primitive type and Reference type. Conversion of primitive type to its...

Method overloading and null error in Java

In Java it is very common to overload methods. Below is an interesting Java program. public class Test {...

Method overloading and null error in Java

In Java it is very common to overload methods. Below is an interesting Java program. public class Test {...

Different ways of Method Overloading in Java

Java can distinguish the methods with different method signatures. i.e. the methods can have the same name but with...

Different ways of Method Overloading in Java

Java can distinguish the methods with different method signatures. i.e. the methods can have the same name but with...

Variable Arguments (Varargs) in Java

In JDK 5, Java has included a feature that simplifies the creation of methods that need to take a...

Variable Arguments (Varargs) in Java

In JDK 5, Java has included a feature that simplifies the creation of methods that need to take a...

Valid variants of main() in Java

We know that a Java code begins to execute from the main method. During runtime, if JVM can’t find...

Valid variants of main() in Java

We know that a Java code begins to execute from the main method. During runtime, if JVM can’t find...

Throwable fillInStackTrace() method in Java

The fillInStackTrace() method, of java.lang.Throwable class, records within this Throwable object information about the current state of the stack...

Throwable fillInStackTrace() method in Java

The fillInStackTrace() method, of java.lang.Throwable class, records within this Throwable object information about the current state of the stack...