QUESTION 15 An error is generated by the compiler when you attempt to override a
ID: 3691511 • Letter: Q
Question
QUESTION 15
An error is generated by the compiler when you attempt to override a static method with a nonstatic method.
True
False
QUESTION 16
Java contains a class named ____ that allows you to produce dialog boxes.
JBox
JGUI
JDialog
JOptionPane
QUESTION 17
A(n) ____ variable is known only within the boundaries of the method.
double
local
method
instance
QUESTION 18
When a numeric variable is concatenated to a String, the entire expression becomes a(n) ____.
String
constant
int
method
QUESTION 19
Each JMenu can contain options, called JMenuItems, or can contain submenus that are ____.
JMenus
JMenuBars
JSubMenus
JMenuChildren
QUESTION 20
The ____ operator is always evaluated before the OR operator.
Logical
Assignment
Conditional
AND
QUESTION 21
Locating and repairing all syntax errors is part of the process of ____ a program.
compiling
executing
interpreting
debugging
QUESTION 22
Which of the following is NOT an initial value assigned to an object’s data field by a default constructor?
numeric fields set to 0
a field of object references set to null
character fields set to Unicode ‘u0000’
Boolean fields set to true
QUESTION 23
Regarding enumerations, the ____ method returns the name of the calling constant object.
nameOf
constName
ordinal
toString
QUESTION 24
The compiler determines which version of a method to call by the method’s ____.
constructor
name
signature
output
QUESTION 25
When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.
constructor
parameter
scope
output
QUESTION 26
When you initialize parallel arrays, it is convenient to use ____ so that the values that correspond to each other visually align on the screen or printed page.
spacing
indentation
tabs
dashes
QUESTION 27
An additional layered pane exists above the root pane, but it is not often used explicitly by Java programmers.
True
False
QUESTION 28
If you create an empty method within an abstract class, the method is abstract even if you do not explicitly use the keyword abstract.
True
False
QUESTION 29
Which FontMetrics class method returns information about the part of characters that hang below the baseline?
getAscent()
getLeading()
getHeight()
get_Descent()
QUESTION 30
When working with logical operators, you can always use ____ to change precedence.
parentheses
conditional operators
break statements
semicolons
QUESTION 31
int[][] myVals = {{2, 4, 6},
{1, 3, 5, 7}};
Using the above array, what is the value of myVals.length?
5
1
2
4
QUESTION 32
The String class ____ method evaluates the contents of two String objects to determine if they are equivalent.
charAt()
equals()
toString()
replace()
QUESTION 33
When a protected data field or method is created, it can be used within its own class or in any classes extended from that class; but it cannot be used by outside classes.
True
False
QUESTION 34
A ____ is placed at the top of a container and contains user options.
content pane
glass pane
containment hierarchy
menu bar
QUESTION 35
Which of the following statements will change the value displayed in a JLabel named hello?
hello = setText("Hello");
setText.hello = "Hello"
setText = hello
hello.setText("Hello");
QUESTION 36
While a class can inherit from multiple abstract superclasses, it implement only one interface.
True
False
QUESTION 37
If you want all objects to share a single nonchanging value, then the field is static and ______.
class
permanent
end
final
QUESTION 38
The simplest possible sort involves two values that are out of order.
True
False
QUESTION 39
When you create a superclass and one or more subclasses, each object of each subclass is a subclass object.
True
False
QUESTION 40
When constructing a Font object, which of the following arguments is NOT required?
style
typeface
point size
weight
QUESTION 41
It is common to create an interface when you want a class to implement behavior from more than one parent.
True
False
QUESTION 42
The following statement produces a dark purple color that has green and blue components, but no red:
Color darkPurple = new Color(100, 0, 100);
True
False
QUESTION 43
An application’s main() method must have a void return type.
True
False
QUESTION 44
The parent class of MouseEvent is ____.
EventObject
AWTEvent
UserEvent
InputEvent
QUESTION 45
The expression boolean isTenLarger = (10 < 5) will produce a value of true.
True
False
QUESTION 46
A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while executing.
package
run-time error
Java API
syntax error
QUESTION 47
You can create a confirm dialog box with five arguments.
True
False
QUESTION 48
You can leave out the ____ statements in a switch structure.
case
break
switch
if
QUESTION 49
Clicking a component results in a(n) ____.
WindowEvent
ItemEvent
ActionEvent
MouseEvent
QUESTION 50
Method names that begin with ____ and set are very typical.
read
call
get
next
a.JBox
b.JGUI
c.JDialog
d.JOptionPane
Explanation / Answer
15.true
48.B
49.C
45:false
44.a
43.false
41.true
39.true
37.d
33.true
32.b
28.true
22.a
21.a
20.d
17.c
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.