stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
IT180 - Intro to Prog Java All Chapters Flashcards | StudBud
Explore
/
IT180 - Intro to Prog Java All Chapters
IT180 - Intro to Prog Java All Chapters
65 terms
·
StudBud Administration
·
131 plays
Preparation for the Final Exam for Java
Flashcards
65 cards
F
Practice quiz
P
Host live
L
Questions
65
Answers
1
A
for
loop normally performs which of these steps?
initializes a control variable to a starting value
All of these
None of these
updates the control variable during each iteration
2
The primitive data types only allow a(n) ________ to hold a single value.
class
variable
literal
object
3
An object's _____ is simply the data that is stored in the object's fields at any given moment.
state
value
assessment
record
4
This does not allow a statement to use a subscript that is outside the range of valid subscript
buffer overrun protection
scope resolution binding
active array sequencing
array bounds checking
5
The ________ statement is used to make simple decisions in Java.
if
branch
do/while
for
6
By default, Java initializes array elements with what value?
-1
100
1
0
7
A ragged array is:
two-dimensional array where rows are of different lengths
two-dimensional array which the number of rows is unknown
one-dimensional array and the number of elements is unknown
There is no such thing as a ragged array
8
In Java, ________ must be declared before they can be used.
key words
comments
variables
literals
9
The ability to catch multiple types of exceptions with a single catch is known as ________
exception trapping
super catch
compound catch
multi-catch
10
Application software refers to:
The operating system
Pseudocode
The programs that make the computer useful to the user
Key words
11
A class's responsibilities include:
responsible for knowing
neither responsible for doing nor knowing
responsible for doing
responsible for doing and responsible for knowing
12
In Java, when a character is stored in memory, it is actually stored as a(n):
Morse code
EBCDIC character code
ASCII character code
Unicode number
13
A byte is a collection of:
a Dollar
Four bits
Six bits
Eight bits
14
This is an object that is generated in memory as the result of an error or an unexpected event.
default exception handler
error message
exception
exception handler
15
JFC stands for:
Java Fundamental Classes
Java Fundamental Core
Java Foundation Classes
Java Frame Class
16
The exception classes are in packages in the ________.
Java API
Ex class
JVM
Compiler
17
This is a
library
of classes that provide an improved alternative for creating GUI applications
Swing
Jazz
AWT
JFC
18
A class specifies the ________ and ________ that a particular type of object has.
fields; methods
relationships; object names
fields; object names
relationships; methods
19
Internally, the central processing unit (CPU) consists of two parts:
he arithmetic and login unit (ALU) and main memory
The input and output devices
The control unit and the arithmetic and logic unit (ALU)
The control unit and main memory
20
If you attempt to use a local variable before it has been given a value:
the local variable will be ignored
the results will be unpredictable
the local variable will always contain the value 0
a compiler error will occur
21
In a class hierarchy the more
general to the bottom and specialized to the top
general to the right of the tree and specialized to the left
general to the top of the tree and specialized to the bottom
general to the left of the tree and specialized to the right
22
________ inspects data given to the program by the user and determining if it is valid.
User authentication
Input validation
Defensive coding
Data parsing
23
Java was developed by:
Microsoft
Sun Microsystems
IBM
Hewlett-Packard
24
Which of the following will format 12.78 to display as 12.8%?
System.out.printf("%1.2d%", 12.78);
System.out.printf("%.1f%%", 12.78);
System.out.printf("%.2f%%", 12.78);
System.out.printf("%2.1d%", 12.78);
25
The increment operator is:
plus plus ++
minus equals -=
minus minus --
star equals *=
26
Every Java application program must have:
comments
a class named MAIN
a method named main
integer variables
27
A subclass can directly access:
only public and private members of the superclass
only public and protected members of the superclass
only protected and private members of the superclass
all members of the superclass
28
Which of the following statements is NOT true?
Radio buttons & check boxes use the ActionListener interface
Radio buttons are grouped & mutually exclusive
Radio buttons are round and check boxes are square
They are all true
29
Each repetition of a loop is known as what?
A cycle
An iteration
A Lap
An execution
30
A runtime error is usually the result of:
A syntax error
A logical error
Bad data
A compilation error
31
It is common practice to use a ________ variable as a size declarator.
reference
final
static
boolean
32
AWT components are called _____ because they are coupled with their underlying peer classes.
heavyweight
middleweight
featherweight
lightweight
33
When a field is declared static, there will be:
a copy of the field in each class object
only one copy of the field in memory
a copy of the field for each static method in the class
only two copies of the field in memory
34
This OS command line executes the MyApplication class and displays Logo.jpg as a splash screen
java MyApplication -splash
java MyApplication Logo.jpg
java -splash:Logo.jpg MyApplication
java Logo.jpg -splash:MyApplication
35
If you attempt to perform an operation with a null reference variable:
the resulting operation will always be zero
Java will create an object to reference the variable
the program will terminate
the results will be unpredictable
36
A Java program must have at least one of these:
Comment
System.out.println(); statement
Class definition
Variable
37
Which Scanner class method reads a String?
readString()
nextLine()
nextString()
getString()
38
A parameter variable's scope is:
the class to which the method belongs
the main method
the method in which the parameter is declared
All of these
39
All @param tags in a method's documentation comment must:
appear before the method header
span several lines
appear after the general description of the method
end with a */
40
A Boolean expression is one that is either:
true or false
x or y
None of these
Positive or negative
41
The term ________ typically refers to the device that displays console output.
liquid crystal display
standard output device
central processing unit
secondary storage device
42
Which one is NOT a primitive data type?
double
triple
char
int
43
A block of code is enclosed in a set of:
parentheses ( )
double quotes " "
brackets [ ]
braces { }
44
When you are working with a _____, you are using a storage location that holds a piece of data.
binary number
numeric literal
reference variable
primitive variable
45
You should always document a method by writing comments that appear:
just after the method's definition
just before the method's definition
only if the method is more than five lines long
at the end of the file
46
In the cookie cutter metaphor, think of the ______ as a cookie cutter and _____ as the cookies.
class; fields
class; objects
attribute; methods
object; classes
47
A sentinel value ________ and signals that there are no more values to be entered.
guards the list
indicates the start of a list
is a different data type than the values being processed
a value that cannot be mistaken as a member of the list
48
What does the following statement do?
double[ ] array1 = new double[10];
Declares array1 to be a reference for array of double values
Will allow valid subscripts in the range of 0 - 9
All of these
Creates an instance of an array of 10 double values
49
CRC stands for:
Code, Reuse, Constancy
Class, Responsibilities, Collaborations
Class, Recyclability, Collaborations
Class, Redundancy, Collections
50
Arrays in Java have a public field named ___ that contains the number of elements in the array.
limit
size
capacity
length
51
In the header, the method name is always followed by this:
parentheses
data type
return type
braces
52
An exception's default error message can be retrieved using this method.
getDefaultErrorMessage( )
getMessage( )
getDefaultMessage( )
getErrorMessage( )
53
Class objects have _____ that perform operations on their data, but primitive variables do not.
fields
methods
instances
relationships
54
Classes that inherit from the Error class are for exceptions that are thrown when
an IOException occurs & the application should not handle
an IOException error occurs & the application should handle
a critical error occurs & the application should handle
a critical error occurs & the application should not handle
55
Like a family tree, a ________ shows the inheritance relationship between classes.
binary tree
class map
class hierarchy
flowchart
56
A UML diagram does not contain:
the field names
the class name
the method names
object names
57
Breaking a program down into small manageable methods:
allows for code reuse
All of these
simplifies programs
makes problems more easily solved
58
You use the ________ key word in a class header to indicate that it implements an interface.
implements
listener
interface
static
59
A declaration for an enumerated type begins with this key word.
ENUM
enumerated
enum
enum_type
60
When a method is declared with the ________ modifier, it cannot be overridden in a subclass.
final
super
extends
public
61
A flag may have the values:
+1 or -1
0 or 1
true or false
of any character
62
A protected member of a class may be directly accessed by:
methods in the same package
methods of a subclass
All of these
methods of the same class
63
Static methods can only operate on ________ fields.
local
instance
global
static
64
The try statement may have an optional ____ clause, which must appear after all catch clauses.
default
try-again
finally
abort
65
An anonymous inner class must:
implement an interface
both implement an interface and extend another class
either implement an interface or extend another class
extend another class