Question: Given: 1 class Testobj 2 int x; 3 TestObj updateObject({ 4 (X) 5 x=900; return obji 7 } 8 int receiveObject (TestObj obj){ 9 x=100;

Given: 1 class Testobj 2 int x; 3 TestObj updateObject({ 4 (X) 5 x=900; return obji 7 } 8 int receiveObject (TestObj obj){ 9 x=100; 10 return x; 11 } 12 public String coString() { 13 return "Answer=" + x; 14 3 15) 16 class TestRetObject { 17 18 19 public static void main(String[] args) { TestObj obj= new Testobj 0; obi-updateObject(); System.out.println (obj); obj-receiveObject (obj); System.out.println (obj). 20 21 22 23 3 (a) Which line number shows calling a method bypassing an object? (b) Which line number shows calling a method that returns an object? (c) Write a statement in (x) to complete method updateObject(). (d) What will be printed by line 20 and 22 if toString() method line 12-14 are commented
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
