Midterm Exam Flashcards
When you create a block, you must place multiple statements within it.
False
Which of the following is NOT a component of a variable declaration statement?
a.
variable name
b.
ending semicolon
c.
data type identifier
d.
symbolic constant
symbolic constant
Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other uppercase letters to improve readability.
True
The executable file that executes a Java bytecode into a machine code:
Select one:
a.
javax
b.
java
c.
javaw
d.
javah
e.
appletviewer
f.
javac
java
Modulus operator, %, can be applied to which of these?
Select one:
a.
Both Integers and floating
b.
None of the mentioned
c.
Integers
d.
Floating
Both Integers and floating
A ____ is a named memory location that you can use to store a value
a.
primitive
b.
reference
c.
variable
d.
cast
variable
Java methods must be located inside a class.
True
Although not required, it is common procedure to align the keyword if with the keyword else.
True
Which of these is returned by greater than,
Boolean
The literals 5, 23, -2, and 900 are integer literals in Java and are of automatic type long.
False’.
Which of these statement is correct?
Select one:
a.
true and false are non numeric values.
b.
true is any non zero value and false is 0.
c.
true and false are numeric values 1 and 0.
d.
true and false are numeric values 0 and 1.
true and false are non numeric values.
What is the operand of arithmetic operators?
Select one:
a.
Numeric
b.
Both Numeric & Characters
c.
Characters
d.
Boolean
Both Numeric & Characters
All Java statements are terminated with a semicolon.
True
A loop that never ends is called a(n) ____ loop.
a.
while
b.
for
c.
infinite
d.
definite
infinite
Which of these is necessary condition for automatic type conversion in Java?
Select one:
a.
None of the mentioned
b.
The destination type is smaller than source type.
c.
The destination type is larger than source type.
d.
The destination type can be larger or smaller than source type.
The destination type is larger than source type.
____ occurs when both of the operands are integers.
Unlike assignment
b.
Integer division
c.
Data modeling
d.
Type cast
Integer division
Classes and methods are always defined in blocks of code enclosed in {}.
True
In the switch structure, break is followed by one of the possible values for the test expression and a colon.
False
A variable can hold more than one value at a time.
False’.
When you place a block within an if statement, it is crucial to place the ____ correctly.
a.
commas
b.
periods
c.
curly braces
d.
angle brackets
curly braces
When an expression containing a ____ is part of an if statement, the assignment is illegal.
a.
Boolean value
b.
double equal sign
c.
single equal sign
d.
greater than sign
single equal sign
Local variables are variables that are declared inside the class but outside the method.
False’.
A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
‘True’.
true && false || 9 < 4 + 5
False’.