Chapter 6 Quiz Review Flashcards
JLabels are used to get input and show output: (T/F)
False
JFrame is a package: (T/F)
False
What is the name of the Java classes that are provided so that the values of primitive data types can be treated as objects?:
Wrappers
Which of the following is not a required attribute of a window:
Color
Given the declaration:
Integer sum;
The statement num = 25; is known as auto boxing of the int type. (T/F)
True
The method getContentPane of the class JFrame is used to access the content pane of the window: (T/F)
True
An action event is handled by the class JFrame: (T/F)
False
Which modifier is used to build classes On top of classes that are interfaces?
Implements
If Shape is a class and you create a new class Circle that extends Shape, then shape is a _____ and circle is a _____ .
Which word goes in the first blank?
Superclass
Which of the following is not a method of the class JTextField?
setVisible
Every window has a title, width, and height
t/F
True
The Java class you use to create windows:
JFrame
Which of the following GUI components is used to get input into a GUI program ?
JTextField
GUI stands for Graphical User Interface (T/F)
True
Write a program that takes as input the radius of a circle and finds the circumference and area of the circle.
Based on this problem statement which of the follow would most likely be chosen as the class?
Circle
Which of the following statements is not true about GUI programs ?
All components are added directly to the GUI window.
The class Container is included in the package Javax.swing. (T/F)
False
An interface is a class that contains only the method headings, and each method heading is terminated with a period. (T/F)
False
The first step in solving a problem using object-oriented design is to write down a detailed description of the problem. (T/F)
True
When you click a JButton an event is created, known as an action event. (T/F)
True
The class JFrame contains the method add.
False
Both private and implements are modifiers in Java.
True
Write a program to input 5 test scores of a student and calculate and print the mean, median, and mode of the scores.
Which words from this problem statement could we use to determine the operations for this program?
Input, calculate, print.
Given the declaration,
Integer num;
The following statements are equivalent:
num = 25;
num = new Integer(25);
(T/F)
True
The object-oriented design, the nouns found in the problem specification can be used to select the operations in the program.
False
Which package will you most likely have to import in order to write a GUI program?
Java.awt.*
The method addWindowListener is included in the class JFrame. (T/F)
True
Whenever there is a superclass-subclass relationship, the superclass inherits all data members and methods of the subclass. (T/F)
False
Which class is a part of the package Java.awt?
Container
If Shape is a class and you create a new class Circle that extends Shape, then Shape is a(n) ____ and Circle is a(n) ______
Which word goes in the second blank?
Subclass