Click here to watch in Youtube : https://www.youtube.com/watch?v=l4MOZkuRtfo&list=UUhwKlOVR041tngjerWxVccwEmployee.java public class Employee
{
String name;
int age;
/*
* The compiler automatically provides a no-argument default constructor if
* the class does not have any other constructor.
*
* This default constructor will call the no-argument constructor of the
* superclass. In this situation, the compiler will complain if the
* superclass doesn't have a no-argument constructor so you must verify that
* it does. If your class has no explicit superclass, then it has an
* implicit superclass of Object, which does have a no-argument constructor.
*/
}
EmployeeDemoTest.java public class EmployeeDemoTest
{
public static void main(String[] args)
{
/*
* Invokes the no-argument constructor to create a new Employee object
* called employee.
*/
Employee employee = new Employee();
System.out.println("Name : " + employee.name);
System.out.println("Age : " + employee.age);
}
}