JAVA Tutorials

Default Constructor in Java : Free Java Tutorial

A default constructor is automatically generated when the programmer has not specified any constructors explicitly. The compiler is responsible to generate default constructor but not JVM. Also, the compiler will generate default constructor if and only if the class does not contain a constructor. If there is at least one constructor inside the class, then …

Default Constructor in Java : Free Java Tutorial Read More »

Control Flow Mechanisms and Object Creation in Java : Free Java Tutorials

Instance Control Flow and Static Control Flow are both very important control mechanisms in Java. We know that first Static Control Flow takes place and only after an Object Creation, Instance Control Flow takes place. In this tutorial, we will understand how both control mechanisms work simultaneously through an example. // Main Class public class Demo …

Control Flow Mechanisms and Object Creation in Java : Free Java Tutorials Read More »

Understanding Type Casting in Java : Free Java Tutorials

Through typecasting, we are not creating any new object in Java. But we are just providing another type of reference variable to the existing object. That is, we are performing typecasting and not object casting. String str = new String(“Meet”); Object obj = (Object)str; This is essentially same as defining String object with an Object …

Understanding Type Casting in Java : Free Java Tutorials Read More »