Q. Which of the following is the correct syntax for calling a method in Java?

  • (A) myMethod();
  • (B) myMethod(int x);
  • (C) myMethod(5);
  • (D) myMethod(x);
πŸ’¬ Discuss
βœ… Correct Answer: (C) myMethod(5);
Explanation: The syntax for calling a method in Java is to use the name of the method followed by any required parameters in parentheses.
Explanation by: Deepak Sahoo
The syntax for calling a method in Java is to use the name of the method followed by any required parameters in parentheses.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
492
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Deepak Sahoo
Publisher
πŸ“ˆ
91%
Success Rate