Q. 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
}
}

  • (A) One
  • (B) Compilation fails due to an error on line 1
  • (C) Compilation fails due to an error on line 2
  • (D) Compilation succeed but no output.
πŸ’¬ Discuss
βœ… Correct Answer: (B) Compilation fails due to an error on line 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
122
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
80%
Success Rate