Question: Q1. what is the problem with the following code public class Test{ public void testMethod(){ MyObject obj; obj.method1(); } } A.obj does not refer to

Q1.

what is the problem with the following code

public class Test{

public void testMethod(){

MyObject obj;

obj.method1();

}

}

A.obj does not refer to a valid object in the memory as "new" was not used to create the object

B.there is no problem

C.Objects cannot be local members of a method

D.method1() is not defined in the class Test

Q2.

When a method calls another method, which of the following is always pushed onto system stack?

a.Return address which is the address of the instruction following the method call

b.Address of the call statement

c. callee's starting address.

Q18 from th

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!