Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Java | Java Packages | Question 3

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Predict the output of following Java program




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


(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
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads