Oracle 1Z0-808 Exam question no. 26

Q. – Given :-

public class Caller { 
           private void init( ) { 
                   System.out.println("Initialized"); 
           } 
           protected void start( ) { 
                   init(); 
                   System.out.println("Started"); 
         }
}

public class TestCall  {
            public static void main(String[ ] args) { 
                   Caller c= new Caller ( ); 
                   c.start();    // line n1 
                   c.init();      // line n2 
           }
}

What is the result? 

A) Compilation fails at line n1. 

B) Initialized 
     Started 

C) Initialized   
     Started 
     Initialized

D) Compilation fails at line n2.


⧪ please give your answer in a comment section.


Post a Comment

3 Comments