Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

11. What restriction is there on using the super reference in a constructor? A. It can only be used in the parent's constructor. B. Only

11. What restriction is there on using the super reference in a constructor? A. It can only be used in the parent's constructor. B. Only one child class can use it. C. It must be used in the last statement of the constructor. D. It must be used in the first statement of the constructor. ...4/8 12. Can an object be a subclass of another object? A. Yesas long as single inheritance is followed. B. Noinheritance is only between classes. C. Only when one has been defined in terms of the other. D. Yeswhen one object is used in the constructor of another. 13. 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. abstract class is another name for "base class." 14. Can an abstract class define both abstract methods and non-abstract methods? A. Noit must have all one or the other. B. Noit must have all abstract methods. C. Yesbut the child classes do not inherit the abstract methods. D. Yesthe child classes inherit both. 15. Can an abstract method be defined in a non-abstract class? A. Noif a class defines an abstract method the class itself must be abstract. B. Noonly classes are abstract, not methods. C. Yesa method can be declared abstract in any parent as long as the child classes also declare it abstract. D. Yesthere is no restriction on where abstract methods can be defined. 16. What is polymorphism in Java? A. It is when a single variable is used with several different types of related objects at different places in a program. B. It is when a program uses several different types of objects, each with its own variable. C. It is when a single parent class has many child classes. D. It is when a class has several methods with the same name but different parameter types. 17. Given the method declaration below, public void m1(int num1, int num2){} ...5/8 which method declaration override method m1 when written in a subclass? A. public void m2(int num1, int num2){} B. public void m1(int num1, double num2){} C. public string m1(int num1, int num2, int num3){} D. public int m1(int num1, int num2){} 18. When a class implements an interface, what must it do? A. It must redefine each constant from the interface. B. It must declare and 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. 19. What is the base class of nearly all Swing classes? A. Object B. Component C. Swing D. JComponent 20. What is the name for a method that responds to events? A. A container method. B. A snoop method. C. A listener method. D. An application method. 21. Fill in the blanks so that this program displays a JFrame: import java.awt.*; public class microGUI { public static void main ( String[] args ) { JFrame frm = new ___________(); frm.___________( 150, 100 ); frm.___________( true ); } } A. Form, setVisible, setOn B. JFrame, setSize, setVisible C. Frame, setVisible, setSize D. Window, setSize, paint ...6/8 22. Which of the following sets the frame to 300 pixels wide by 200 high? A. frm.setSize( 300, 200 ); B. frm.setSize( 200, 300 ); C. frm.paint( 300, 200 ); D. frm.setVisible( 300, 200 ); 23. What three types of software are needed in a complete GUI program A. GUI Components, Event Listeners, Application Code B. Action Events, Window Objects, Containers C. Frames, Windows, Containers D. Libraries, Toolkits, Interfaces 24. What reserved word is used to distinguish the instance variables of an object from identically named parameters of a constructor? A. this B. that C. mine D. main 25. What is the class that applets are based on? A. applet B. JApplet C. Apple D. AWT 26. Can the source code for your applet be compiled by the usual javac compiler? A. No---because applets have no main() B. No---the web browser compiles the code. C. Yes---an applet is just another class as far as the compiler is concerned. D. Yes---if you are going to run it from the DOS prompt. 27. If you are using the Graphics object gr and wish to change the pen color to red, what should you do? A. gr.setColor( Color.red ) B. gr.setPen( Color.red ) C. setBackground( Color.red ) D. gr.setRed( ) ...7/8 28. What class is the mother of all classes in Java. A. Object Class B. Super Class C. Main Class D. None of the above. 29. What type of inheritance is supported in C++ A. Single Inheritance B. Multiple Inheritance C. Super Inheritance D. Sub-class Inheritance. 30. How many methods are in ActionListerner Interface. A. 1 B. 2 C. 3 D. 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago