PROTECTED METHOD PROGRAM IN JAVA

 class example  
 {  
      protected void method()  
      {  
           System.out.println("constructor...");  
      }  
 }  
 public class cons   
 {  
      public static void main(String[] args)   
      {  
           example obj=new example();  
           obj.method();  
           System.out.println("Hello World!");  
      }  
 }  

Post a Comment

0 Comments