Oracle 1Z0-808 Exam question no. 66

Q.– Given: 

public class App {
       int count; 
       public static void displayMsg ( ) { 
              System.out.println("Welcome Visit Count: " + count++);       // line n1 
       } 
       public static void main(String[] args) { 
               App.displayMsg(); 
               displayMsg ();      // line n2 
       } 


What is the result? 

A) Compilation fails at line n1 

B) Welcome Visit Count: 0 
    Welcome Visit Count: 0 

C) Compilation fails at line n2 

D) Welcome Visit Count: 0 
     Welcome Visit Count: 1


⧪ please give your answer in a comment section. 

Post a Comment

1 Comments