Consider the following client code and assume that it compiles correctly:
public class MyTesterClass
{
public static void main(String[] args)
{
MyClass myObject = new MyClass (12.4, 20);
int value1 = MyClass.SOME_VALUE;
int value2 = myObject.method1();
int value3 = MyClass.method2(20);
}
}
Which of the following is an instance method? (4 points)
Question 4 options:
1)
method1
2)
method2
3)
MyClass
4)
SOME_VALUE
5)
This cannot be determined by examining the above code
Question 5 (4 points)
Saved
Listen
When one method calls another, which of the following statements are true? (4 points)
The class methods and instance methods of one class may call the public class methods of another class using dot notation and referencing the name of the other class.
The class methods and instance methods of one class may call the public instance methods of another class by using dot notation to invoke the method on an instance of the other class.
The instance methods of a class may call, only using dot notation, any class method of the same class.
Question 5 options:
1)
I only
2)
III only
3)
I and II only
4)
I and III only
5)
I, II, and III