Question: IN JAVA!!!! above program... class ObjX { int i; public String toString () { String s = i= + i; return s; } } public
IN JAVA!!!!

above program...
class ObjX { int i; public String toString () { String s = "i=" + i; return s; } } public class DynamicExample11 { public static void main (String[] argv) { // Make an ObjX instance and assign something to its variable i. ObjX x = new ObjX (); x.i = 5; // Note how "x" is directly given to println() System.out.println (x); // Another use: String outputStr = "Object x: " + x; System.out.println (outputStr); } }In-Class Exercise 10: Download the above program and remove the tostring() method from objX. Then compile and run. What do you see
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
