Why Static?
Suppose that we would like to maintain, somehow, the number of instances of Employee that were ever created. The following does not work!public class Employee {public int noEmps= 0; //Number of Employees ever createdpublic String name;// Constructor -- An Employee named npublic Employee(String n) { noEmps= noEmps+1; name= n; }}