1

Determine output: class MyClass{ int i; int j; public MyClass(int i, int j){ this.i = i; this.j = j; } public void call(){ System.out.print("One"); } } public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); //line 1 m.call(); //line 2 } }

Correct Answer: Compilation fails due to an error on line 1

Make the most of this question

This page focuses on one JAVA MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

JAVA MCQs MCQ: Determine output: class MyClass{ int i; int j; public MyClass(int i, int j){ this.i = i; this.j = j; } public void call(){ System.out.print("One"); } } public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); //line 1 m.call(); //line 2 } } | Extra Education