Assume that the following code exists inside a method of SomeClass, and that this code compiles without errors:

int result = obj.calculate(4, 3.14);


Which of the following can you know to be true about the calculate method?

I. It is a public method.

II. It is located in SomeClass.

III. It is not located in SomeClass.


a.Statement I only.

b.Statement II only.

c.Statement III only.

d.Statements I and II only.

e.Statements I and III only.

Verified Answer :

Hagrid

The correct answer for this question is this one: "d.Statements I and II only."

The code fragment "
int result = obj.calculate(4, 3.14);" shows that the method calculate is a public one and it is located in a SomeClass that is also public. In this way, the method is easier to access through a certain object.