Q. What is the output of the below Java program?

Code:
class Road
{
  static void show()
  {
    System.out.println("Inside static method.");
  }
}

public class TestingMethods10
{
  public static void main(String[] args)
  {
    Road.show();
  }
}
  • (A) Inside static method.
  • (B) empty message
  • (C) Compiler error
  • (D) Runtime error / exception
πŸ’¬ Discuss
βœ… Correct Answer: (A) Inside static method.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
253
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
95%
Success Rate