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