Category Archives

Static blocks in Java

Unlike C++, Java supports a special block, called static block (also called static clause) which can be used for...

Static blocks in Java

Unlike C++, Java supports a special block, called static block (also called static clause) which can be used for...

Overriding toString() in Java

This post is similar to Overriding equals method in Java. Consider the following Java program: // file name: Main.java...

Overriding toString() in Java

This post is similar to Overriding equals method in Java. Consider the following Java program: // file name: Main.java...

Overriding equals method in Java

Consider the following Java program: class Complex { private double re, im; public Complex(double re, double im) { this.re...

Overriding equals method in Java

Consider the following Java program: class Complex { private double re, im; public Complex(double re, double im) { this.re...

Object class in Java

Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object...

Object class in Java

Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object...