Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1(Multiple Choice Worth 4 points) A public class method may be invoked after which of the following occurs? The class is defined. The main
Question 1(Multiple Choice Worth 4 points) A public class method may be invoked after which of the following occurs? The class is defined. The main method is defined. All instance variables are assigned. O An instance of the class is created. The instance methods are invoked. Question 2(Multiple Choice Worth 4 points) Which of the following describes an overridden method? Any method that invokes super () ; A method that contains a call to itself One of many methods in a class with the same name but different return values O One of many methods in a class with the same name but different parameter lists O A method in a subclass with the same method heading as a method in a parent classQuestion 3(Multiple Choice Worth 4 points) When one method calls another, which of the following statements are true? 1. 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. II. 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. Ill. The instance methods of a class may call, only using dot notation, any class method of the same class. OI only O Ill only O I and II only O I and Ill only OI, II, and IllQuestion 4(Multiple Choice Worth 4 points) Consider the following incomplete class: public class MyClass public static void someMethod () f // implementation not shown public void someOtherMethod () // implementation not shown private void yetAnotherMethod () // implementation not shown The method yetAnotherMethod is defined as private. This means the method is accessible outside MyClass the method is not accessible outside MyClass the method is accessible only by a static method of MyClass O the method is accessible without instantiating a MyClass object the method is accessible only by using a previously instantiated MyClass objectQuestion 5(Multiple Choice Worth 4 points) 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 valuel = MyClass . SOME_VALUE; int value2 = myObject .method1 () ; int value3 = MyClass . method2 (20) ; Which of the following is a static method? O methodl O method2 SomeClass SOME VALUE This cannot be determined by examining the above code
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