stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CS2- Test2- Java - Chapter 2 - 9 Review Flashcards | StudBud
Explore
/
CS2- Test2- Java - Chapter 2 - 9 Review
CS2- Test2- Java - Chapter 2 - 9 Review
60 terms
·
StudBud Administration
A #Java quiz to review basic object-oriented programming concepts with students.
Flashcards
60 cards
F
Practice quiz
P
Host live
L
Questions
60
Answers
1
A data type that can contain any number of characters is called:
Text
Char
String
Digit
2
Information that is given to the user by the program is called:
Cast
Output
Input
Prompt
3
Error caused because the computer will only store a specific number of digits-no rounding.
Compile Error
Run-time Error
Round Off Errors
Computation Error
4
When comparing values in an if statement, what relational operator is used to mean not equal?
!=
=!
==
<>
5
In Java, the = sign means what?
it has no meaning in Java
meaning depends on where it's used
A value is assigned to a variable or constant
A value is equal to another value
6
Every Java program consists of one or more of these fundamental building blocks.
Applet
Parameter
CPU
Class
7
What is the return type of a constructor?
A constructor does not have a return type.
void
private
public
8
The rule that defines which operator is evaluated first is called:
Rule of Law
Order of Operations
Robert's Rules of Order
Murphy's Law
9
A single letter, symbol, or digit is called a
Symbol
Type
Cartoon
Character
10
What is the process of hiding object data and providing methods for data access called?
instantiation
encapsulation
abstraction
documentation
11
What is the name of the file declaring the class named MyClass?
MyClass.java
MyClass
MyClass.class
myclass.java
12
A string that tells the user what information to provide is called a:
Input
Prompt
Poke
Output
13
Setting a variable's initial value is called:
Instance
Inferrence
Initialization
Instantiation
14
To place one string after another to create a new string; adding strings together:
Addition
Merge
Concatenate
Combine
15
What statement is used to specify the value that a method gives back to its caller?
public
private
new
return
16
What does CPU stand for?
Computer Processing unit
Central Processing Unit
Computer Programming Unit
Central Programming Unit
17
What term is used to refer to a sequence of characters enclosed in quotation marks?
String
Comment
Object
Variable
18
What type of program can you use to enter your Java program?
Spreadsheet
Compiler
Database
Editor
19
What translates Java source code into files that contain instructions from the JVM?
Compiler
Linker
Interpreter
Assembler
20
In Java, every statement must end with this symbol.
;
}
!
.
21
Parameters to methods are enclosed by these symbols.
{}
**
()
//
22
What is the name of the constructor for the
BankAccount
class?
BankAccount
deposit
withdraw
balance
23
Information about each class in the Java library is found in the:
Appendix
API Documentation
JPI Documentation
Code Hints
24
When a decision statement is contained inside the branch of another decision statement:
the statements are nested
the statements are parallel
the statements don't work
the statements are sequential
25
The output of a method is called its ________________ value.
Parameter
Return
Implicit
Explicit
26
Collection of code - programmed & translated by someone else - ready for use in your programs
Parameter
Library
Method
Class
27
A ____ contains sequences of instructions to perform a particular task.
Method
Label
Parameter
Variable
28
Which statement best describes a computer program?
a program can only perform one simple task
sequence of instructions/decisions the computer carries out
a sequence of comments
decides what task it is to perform
29
Which statement best describes the portability characteristic of Java?
same Java class files run on different OSs without change
easy to copy Java source code from one machine to another
Easy to compile Java source code one different OSs
Easy to change a program so it'll work on different OSs
30
A reserved word used to declare and define constants is:
Char
Void
Final
Static
31
Making sure the user-supplied values are valid before using them in computations is called:
processing tests
output validation
input validation
quality control
32
A testing method that does not take the structure of the implementation into account is called:
Boundary testing
Code Coverage
Black-box testing
White-box testing
33
Symbols that indicate a mathematical or logical operation
Expressions
Math
Operators
Constructors
34
Converting a value from one type to a different type is called:
Basting
Fishing
Casting
Changing
35
To get a printout of the program flow, you can insert __ into the program (println for example)
console output
trace messages
quoted statements
logging messages
36
@param denotes what type of variable?
instance variable
parameter variable
return variable
constant
37
What is the syntax for calling the println method on the object System.out?
System.out.println ("Any message");
Println("any message").system.out
Println(System.out, "any message");
System.out("Any message").println;
38
Private instance variables _____________________
can only be accessed by methods of the same class
can only be accessed by the constructor of the class
cannot be accessed by methods of the same class
can only be accessed by methods of a different class
39
A value that cannot be changed by a program is called a:
magic number
final
constant
static number
40
What is the output of the following Java statement?
46
4+6
4
10
41
To increase or add to a value is to:
Inflate
Deflate
Increment
Decrement
42
By convention, classes begin with a(n)
Dollar sign
Lowercase letter
Digit
Uppercase letter
43
The _____ statement is used to implement a decision based on a condition or set of conditions
If
Do
While
GoTo
44
What is the term used to refer to Java code that runs in a browser?
Class
Script
Html
Applet
45
Which terminology describes a method that modifies the internal data of its implicit parameter?
accessor
public
void
mutator
46
What does an object store its data in?
access specifiers
instance variables
files
methods
47
The Boolean data type has exactly two values. What are they?
false and true
either and or
beginning and ending
yes and no
48
Java has two Boolean operators that combine conditions; they are:
&& (or) and || (and)
&& (and) and || (or)
!& (or) and !!(and)
&&(and) and !!(or)
49
This testing method uses information about the structure of a program.
Boundary testing
White-box testing
Code coverage
Black-box testing
50
To use a class in another package you need to __________________ it.
import
export
overload
rewrite
51
Encapsulation allows a programmer to use a class without having to know its________________.
name
methods
implementation
interface
52
The name of the constructor is always the same as the name of the _______________________.
parameter variable
access specifier
instance variable
class
53
A ____________ is a collection of classes with a related purpose.
package
import
collection
method
54
Each object of a class has its own set of ____________________.
methods
classes
instance variables
constructors
55
What term is used to refer to text in a program that helps human readers understand the program
Comments
Constants
Methods
Statement
56
You should declare all instance variables as _______________.
public
private
protected
class
57
What is the length of the string "Java Program"?
14
11
none of these
12
58
Standard code assigned values consisting of two bytes to characters used in text around world:
Translation
Bytecode
Universal Code
Unicode
59
Information provided to the program to make it run correctly:
Input
Instance
Output
Override
60
When a Java application starts, what is the name of the method that is executed?
Main
start
main
begin