MCQs > IT & Programming > Java > What would happen on trying to compile and run the following code? public class MainCls { public static void main(String argv) { System.out.println('My Text'); } }

Java MCQs

What would happen on trying to compile and run the following code?

public class MainCls
{
     public static void main(String argv)
     {
 System.out.println("My Text");
     }
}

Answer

Correct Answer: The code will compile. A runtime error will occur because 'main' is not properly defined

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it