Review Game Zone
Flash Cards
(current)
Games
Teachers
Search
Java Module 4
Test Description: Identifiers, Assignment Operators and Numeric Data Type
Instructions: Answer all questions to get your test result.
1) Which of the following is a valid identifier?
A
$total
B
9x
C
8+9
D
class
2) An identifier that cannot be used as a variable name is a ___________________ word
A
key
B
reserved
C
long
D
special
3) Before a variable is used it must be _______________
A
defined
B
declared
C
imported
D
assigned
4) An int variable can hold:
A
120.5
B
abc
C
120
D
'x'
5) In Java, which of the following is not a numerical type?
A
double
B
char
C
byte
D
int
6) Which of the following is a correct name for variables according to Java camel case naming conventions?
A
findArea
B
FindArea
C
findarea
D
FINDAREA
7) To declare a constant MAX_LENGTH inside a method with value 99.98, you write
A
final MAX_LENGTH = 99.98;
B
final double MAX_LENGTH = 99.98;
C
none of the above
D
double MAX_LENGTH = 99.98;
8) Which of the following is the correct way to declare a variable?
A
int length, int width;
B
int length; width;
C
int length width;
D
int length, width
9) What is the result of 45 / 4?
A
12
B
10
C
11
D
11.25
10) Which of the following expression results in a value 1?
A
15 % 4
B
25 % 5
C
2 % 1
D
37 % 6
11) 25 % 1 is _____
A
1
B
2
C
0
D
3
12) To declare an int variable number with initial value 2, you write ___________
A
int number = 2L;
B
integer number = 2;
C
int number = 2;
D
int number = 2.0;
13) The expression 4 + 20 / (3 - 1) * 2 is evaluated to ______________
A
9
B
4
C
20
D
24
14) Suppose x is 1. What is x after x += 2?
A
3
B
-1
C
1
D
4
15) Which of the following contains a valid comment?
A
int twoPi = 2 * 3.14159; /* holds the value of two times pi */
B
none of the above
C
int twoPi = 2 * 3.14159; /* holds the value of two times pi //*
D
int twoPi = 2 * 3.14159; /*/ *holds the value of two times pi //*
16) Which of the following is a valid Java variable?
A
_thisDog
B
95miles
C
numbers#text
D
final
17) How would you assign the integer 5 to a variable named numberFive? Assume the variable is already declared
A
numberFive == 5;
B
5 = numberFive;
C
numberFive = 5;
D
numberFive := 5;
*select an answer for all questions
Check Results & Get Answers
Play Games with the Questions Above
Teachers: Create FREE classroom games with your questions
Click for more info!
©2007-2024
ReviewGameZone.com
|
About
|
Privacy
|
Contact
|
Terms
|
Site Map
WAIT! Find what you needed?
×
Still Looking for the Answers?
Have Another Question?
Play a Review Game with These Questions?
Want to Make Your Own Test Like This One?