Question: Moving to another question will save this response. Question 2 1. public class MyClass{ 2. public int x; 3. public MyClass() { this.x = 0;


Moving to another question will save this response. Question 2 1. public class MyClass{ 2. public int x; 3. public MyClass() { this.x = 0; } 4. public MyClass(int x){this.x = x; } 5. public MyClass(MyClass oX this.x=0.x; } 6. public void setX(int x){this.x=x; } 7. } //end of class MyClass The constructor in line 5 is: Not a constructor Copy Constructor Overloaded Constructor Default Constructor A Moving to another question will save this response. response. Question 3 What is the output of the following code? public class MyClass{ int x = 0; public MyClass(int s) { x = 5; } public void setX(int s}x=s; } public int getxo{ return x; } y/end of class MyClass public class Test: public static void main(String[] args) MyClass c = new MyClass(5): c.setic.getX()*2); System.out.printlnic.getxo) > Wend of class Test }l/end of class MyClass public class Test{ public static void main(String args MyClass = new MyClass(5); C.setX(c.getX0*2); System.out.println(c.getX(); } Hlend of class Test 0 10 Error 5 A Moving to another question will save this response
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
