Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!