Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

17. Consider the code segment public class Childclass extends SuperClassl, Super

ID: 3590138 • Letter: 1

Question


17. Consider the code segment public class Childclass extends SuperClassl, SuperClass2 ( public Childclass System.out.printin ("instantiating child class") public static void main (String l args)f ChildClass cc = new ChildClass(); What is the output? A - Not enough information to determine B Compile error C -"instantiating child class" D - no output -18. Can an interface be given the final modifier? public final interface InterfaceA definitions A No---then the interface could never be inherited. B - No-since the interface instance variables are already final. C-Yes-this would make all of its methods and constants final. D -Yes--this would mean that the interface can be inherited by another final class. 19. When a class implements an interface, what must it do? A It must redefine each constant from the interface. d provide a method body for each method in the interface. C - It must declare a variable for each constant in the interface. D - It must include a private method for each method in the interface 20. What is an abstract class? A - An abstract class is one without any child classes. B - An abstract class is any parent class with more than one child class. C - An abstract class is class which cannot be instantiated. D - An abstract class is another name for "base class."

Explanation / Answer

17)

Ans-a

19)

Ans-b

It must declare and provide a method body for each method in the interface

20)

Ans-c

An abstract class is a class which has at least one abstract method which cannot be instantiated

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote