Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lets assume this: public class first { public void method1() { System.out.println(method 1); } } public class second { public static void method2() { System.out.println(method
Lets assume this:
public class first { public void method1() { System.out.println("method 1"); } } public class second { public static void method2() { System.out.println("method 2"); } } public class third { second obj4 = new second(); public void method1() { System.out.println("method 3");
second.method2();
} }
And that these were created in the main.
first obj1 = new first(); second obj2 = new second(); second obj3= new first();
What is the output for object3.method1 and object3.method2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started