Java | Java Packages | Question 3

Predict the output of following Java program

filter_none

edit
close

play_arrow

link
brightness_4
code

// Note static keyword after import.
import static java.lang.System.*;
    
class StaticImportDemo
{
   public static void main(String args[])
   {      
        out.println("GeeksforGeeks");
   }
}

chevron_right


(A) Compiler Error
(B) Runtime Error
(C) GeeksforGeeks
(D) None of the above


Answer: (C)

Explanation: Please refer https://www.geeksforgeeks.org/packages-in-java/

Quiz of this Question

My Personal Notes arrow_drop_up

Recommended Posts:

    Article Tags :

    Be the First to upvote.


    Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.