Deck 1: Introduction to Computers, Programs, and Java
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/9
Play
Full screen (f)
Deck 1: Introduction to Computers, Programs, and Java
1
Assume x is 0. What is the output of the following statement? 

C
2
What is the printout of the following switch statement? 
A) ab
B) a
C) aa
D) abc
E) abcd

A) ab
B) a
C) aa
D) abc
E) abcd
B
3
Which of the following is a constant, according to Java naming conventions?
A) read
B) MAX_VALUE
C) ReadInt
D) Test
A) read
B) MAX_VALUE
C) ReadInt
D) Test
B
4
What is y after the following switch statement is executed? 
A) 1
B) 4
C) 3
D) 2
E) 0

A) 1
B) 4
C) 3
D) 2
E) 0
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck
5
To declare a constant MAX_LENGTH inside a method with value 99.98, you write
A) final double MAX_LENGTH = 99.98;
B) double MAX_LENGTH = 99.98;
C) final MAX_LENGTH = 99.98;
D) final float MAX_LENGTH = 99.98;
A) final double MAX_LENGTH = 99.98;
B) double MAX_LENGTH = 99.98;
C) final MAX_LENGTH = 99.98;
D) final float MAX_LENGTH = 99.98;
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck
6
Analyze the following code: 
A) Code 2 has syntax errors.
B) Code 1 has syntax errors.
C) Both Code 1 and Code 2 have syntax errors.
D) Both Code 1 and Code 2 are correct, but Code 2 is better.

A) Code 2 has syntax errors.
B) Code 1 has syntax errors.
C) Both Code 1 and Code 2 have syntax errors.
D) Both Code 1 and Code 2 are correct, but Code 2 is better.
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck
7
What is x after evaluating x = (2 > 3) ? 2 : 3;
A) 5
B) 2
C) 3
D) 4
A) 5
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck
8
What is y after the following switch statement? 
A) 2
B) 1
C) 0
D) -1

A) 2
B) 1
C) 0
D) -1
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck
9
Analyze the following code. 
A) The value of variable x is always printed.
B) The symbol x is always printed twice.
C) The symbol x is always printed.
D) Nothing is printed because x > 0 is false.

A) The value of variable x is always printed.
B) The symbol x is always printed twice.
C) The symbol x is always printed.
D) Nothing is printed because x > 0 is false.
Unlock Deck
Unlock for access to all 9 flashcards in this deck.
Unlock Deck
k this deck