Question text A(n) ____ is a method of a class that is automatically executed wh
ID: 3741638 • Letter: Q
Question
Question text
A(n) ____ is a method of a class that is automatically executed when an object of the class is created.
Select one:
a. package
b. interface
c. constructor
d. inheritance
Question 2
Not yet answered
Question text
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.
Which word goes in the first blank in the sentence above?
Select one:
a. superclass
b. inherited class
c. subclass
d. package
Question 3
Not yet answered
Points out of 1.00
Flag question
Question text
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.
Which word goes in the second blank of the sentence above?
Select one:
a. method
b. package
c. superclass
d. subclass
Question 4
Not yet answered
Points out of 1.00
Flag question
Question text
The Java class that you use to create windows is ____.
Select one:
a. JFrame
b. JButton
c. JTextField
d. JLabel
Question 5
Select one:
a. Show output
b. Get input and show results
c. Display a prompt to the user
d. Get input
Question 6
To create a window, which of the following classes has to be extended?
Select one:
a. JTextField
b. Container
c. JFrame
d. JButton
Question 7
Not yet answered
To display a window, you must invoke the method ____.
Select one:
a. displayWindow
b. setVisible
c. setDisplay
d. show
Question text
What is the name for Java classes that are provided so that values of primitive data types can be treated as objects?
Select one:
a. wrappers
b. extensions
c. event handlers
d. interfaces
Question 9
Not yet answered
Points out of 1.00
Flag question
Question text
Which class is part of the package java.awt?
Select one:
a. JButton
b. Container
c. JOptionPane
d. JFrame
Question 10
Not yet answered
Points out of 1.00
Flag question
Question text
Which method contains the code that the program executes when a specific event is generated?
Select one:
a. GUIListener
b. actionPerformed
c. windowListener
d. buttonListener
Question 11
Not yet answered
Points out of 1.00
Flag question
Question text
Which method is used to register a listener object to a button object?
Select one:
a. registerButton
b. eventButton
c. addActionListener
d. buttonListener
Question 12
Not yet answered
Points out of 1.00
Flag question
Question text
Which modifier is used to build classes on top of classes that are interfaces?
Select one:
a. public
b. new
c. implements
d. private
Question 13
Not yet answered
Points out of 1.00
Flag question
Question text
Select one:
a. Perimeter
b. Exit
c. Calculate
d. Both Calculate and Exit
Question 14
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following is a reserved word in Java?
Select one:
a. inheritance
b. pane
c. event
d. extends
Question 15
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following is not a method of the class JTextField?
Select one:
a. setVisible
b. setEditable
c. setText
d. addActionListener
Question 16
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following is NOT a required attribute of a window?
Select one:
a. color
b. title
c. height
d. width
Question 17
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following is NOT found within the content pane?
Select one:
a. buttons
b. title bar
c. labels
d. text areas
Question 18
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following methods is NOT part of the class JFrame?
Select one:
a. getText
b. setTitle
c. setSize
d. setVisible
Question 19
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following sets the window width to 100 pixels and the height to 200 pixels?
Select one:
a. setSize(200, 100);
b. set(200, 100);
c. setDims(100, 200);
d. setSize(100, 200);
Question 20
Not yet answered
Points out of 1.00
Flag question
Question text
Which of the following statements is NOT true about GUI programs?
Select one:
a. Every window has a title, width, and height.
b. A layout must be created before components can be added to a content pane.
c. All components are added directly to the GUI window.
d. Every GUI program requires a window.
Question 21
Not yet answered
Points out of 1.00
Flag question
Question text
Which package will you most likely have to import in order to write a GUI program?
Select one:
a. java.awt.*
b. java.text.*
c. java.net.*
d. java.io.*
Question 22
Not yet answered
Points out of 1.00
Flag question
Question text
Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.
Based on the problem statement above, which of the following would most likely be chosen as the class?
Select one:
a. Pay_Rate
b. Pay
c. Employee
d. Hours_Worked
Question 23
Not yet answered
Points out of 1.00
Flag question
Question text
Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.
Based on the problem statement above, which of the following would be a data member?
Select one:
a. pay
b. hoursWorked
c. employee
d. job
Question 24
Not yet answered
Points out of 1.00
Flag question
Question text
Write a program to input the radius of the base and height of a cylinder, and calculate and print the surface area, volume, and area of the base of the cylinder.
According to the problem statement above, which of the following would be a data member?
Select one:
a. Input
b. Radius of the base
c. Surface area
d. Volume
Question 25
Not yet answered
Points out of 1.00
Flag question
Question text
Write a program to input the radius of the base and height of a cylinder, and calculate and print the surface area, volume, and area of the base of the cylinder.
Which words from the problem statement above could we use to determine the operations for this program?
Select one:
a. cylinder, program, volume
b. input, calculate, print
c. radius, cylinder, print
d. height, cylinder, radius
Question 26
Not yet answered
Points out of 1.00
Flag question
Question text
An interface is a class that contains only the method headings and each method heading is terminated with a semicolon.
Select one:
True
False
Question 27
Not yet answered
Points out of 1.00
Flag question
Question text
Every window has a title, width, and height.
Select one:
True
False
Question 28
Not yet answered
Points out of 1.00
Flag question
Question text
Given the declaration,
Integer num;
The statement num = 8; is known as autoboxing of int type.
Select one:
True
False
Question 29
Not yet answered
Points out of 1.00
Flag question
Question text
Given the declaration,
Integer x;
After executing either of the following two statements, x points to an Integer object with value 8:
x = 8;
x = new Integer(8);
Select one:
True
False
Question 30
Not yet answered
Points out of 1.00
Flag question
Question text
GUI components are placed in a window called JFrame.
Select one:
True
False
Question 31
Not yet answered
Points out of 1.00
Flag question
Question text
If lengthTF is a JTextField and pane is a container, then the statement pane.add(lengthTF); adds the text field to the content pane of a window.
Select one:
True
False
Question 32
Not yet answered
Points out of 1.00
Flag question
Question text
In Java, data members are also known as fields.
Select one:
True
False
Question 33
Not yet answered
Points out of 1.00
Flag question
Question text
In Java, extends is a reserved word.
Select one:
True
False
Question 34
Not yet answered
Points out of 1.00
Flag question
Question text
In Java, there is one way to make an application program create a window.
Select one:
True
False
Question 35
Not yet answered
Points out of 1.00
Flag question
Question text
In object-oriented design, the nouns found in the problem specification can be used to select the operations in the program.
Select one:
True
False
Question 36
Not yet answered
Points out of 1.00
Flag question
Question text
In object-oriented design, the verbs in the problem specification can be used to identify the objects in the program.
Select one:
True
False
Question 37
Not yet answered
Points out of 1.00
Flag question
Question text
JTextFields are used to get input, but not show output.
Select one:
True
False
Question 38
Not yet answered
Points out of 1.00
Flag question
Question text
The class ActionListener contains only one method, actionEvent.
Select one:
True
False
Question 39
Not yet answered
Points out of 1.00
Flag question
Question text
The class Container is included in the package java.awt.
Select one:
True
False
Question 40
Not yet answered
Points out of 1.00
Flag question
Question text
The class JFrame contains the method setSize.
Select one:
True
False
Question 41
Not yet answered
Points out of 1.00
Flag question
Question text
The first step in solving a problem using object-oriented design is to identify objects.
Select one:
True
False
Question 42
Not yet answered
Points out of 1.00
Flag question
Question text
The GridLayout manager arranges GUI components in a list formation.
Select one:
True
False
Question 43
Not yet answered
Points out of 1.00
Flag question
Question text
The height and width of a window are measured in inches.
Select one:
True
False
Question 44
Not yet answered
Points out of 1.00
Flag question
Question text
The method addWindowListener is included in the class JFrame.
Select one:
True
False
Question 45
Not yet answered
Points out of 1.00
Flag question
Question text
The method getContentPane of the class JFrame is used to access the content pane of the window.
Select one:
True
False
Question 46
Not yet answered
Points out of 1.00
Flag question
Question text
To compare the values of two Integer objects for equality, we can use the method equals of the class Integer.
Select one:
True
False
Question 47
Not yet answered
Points out of 1.00
Flag question
Question text
To determine whether two reference variables of the Integer type point to the same Integer object, we can use either the method equals of the class Integer or the operator ==.
Select one:
True
False
Question 48
Not yet answered
Points out of 1.00
Flag question
Question text
When you click a JButton, an event, known as an action event, is created.
Select one:
True
False
Question 49
Not yet answered
Points out of 1.00
Flag question
Question text
Whenever there is a superclass-subclass relationship, the superclass inherits all data members and methods of the subclass.
Select one:
True
False
Question 50
Not yet answered
Points out of 1.00
Flag question
Question text
Wrapper class objects are mutable.
Select one:
True
False
Explanation / Answer
I have answered Q1 to Q6.
Please repost others in separate post.
Q1.
c. constructor
Q2.
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) superclass and Rectangle is a(n) subclass
Q3.
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) superclass and Rectangle is a(n) subclass
Q4.
The Java class that you use to create windows is JFrame
Q5.
Image not visible
Q6.
To create a window, which of the following classes has to be extended?
Ans: c. JFrame
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.