Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. What will be the output of the following code? public class Point int x, y pu

ID: 3910435 • Letter: 6

Question

6. What will be the output of the following code? public class Point int x, y public Point()this(10, 1e) public int getXO return x public int getyO (returm y: public static void main(String args) Point p new PointO System.out.println(p.getx)) a. 10 b. 0 c. Compilation Error d. Runtime Error 7. What is the output of the following program public class Calculator private int num public void calc(int num) this.num num 10; public void printNum() System.out.println(num): public class Driver f public static void main(String[] args) ( Calculator obj new Calculator); obj.calc(2); obj.printNum); a. 20 b. 100 c. 10 d. 2 8. Select from the list methods that are available to a java class to override. i) toString0 ii) getBinaryCode() iii) isEquals0 iv) equals0 a. i, li and iv b. i, ii and ii c. i and iv d. I and ii

Explanation / Answer

Question 6
Anser:
a.10

Question 7
Anser:
a.20

Question 8
Anser:
C. i znd iv