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