Question: answer this please 4 Multiple Choice 2 points 1 class MyClassif void doit() System. out. printIn(doit); class MyClass2{ int x=1; 100 MyClass2(int x) 11 12

answer this please

answer this please 4 Multiple Choice 2 points 1
4 Multiple Choice 2 points 1 class MyClassif void doit() System. out. printIn("doit"); class MyClass2{ int x=1; 100 MyClass2(int x) 11 12 this. x = x; 13 void doit() 15 16 System. out . printIn("doit"+x); 17 18 What happens when the CallMyClass4.java program is executed IN Apublic class CallMyClass4 { MyClass2 mc2 ; void tryMe () JOUDW { mc2 = new MyClass2 () ; mc2 . doit () ; 8 9 10 public static void main (String args) { 11 CallMyClass4 cmc = new CallMyClass4 () ; 12 cmc . tryMe () ; 13 14 O A compile error occurs at line 12 O A compile error occurs at line 6 because a constructor with zero parameters does not exist. O A compile error occurs at line 7 The program compiles and generates the output "doit1" O The program compiles and gets a runtime error at line 7 because mc2 was not constructed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!