Home Segments Top Top Previous Next

288: Practice

Describe and explain what happens when you run the following program:

public class Demonstrate { 
 public static void main (String argv[]) { 
  new Test(); 
 } 
} 
class Test { 
 public Test () { 
  System.out.println("Creating a Test instance"); 
 } 
} 

Then, describe and explain what happens when you mark the zero-parameter constructor with the private keyword.