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
8+9
B
class
C
$total
D
9x
2) An identifier that cannot be used as a variable name is a ___________________ word
A
long
B
reserved
C
key
D
special
3) Before a variable is used it must be _______________
A
imported
B
assigned
C
defined
D
declared
4) An int variable can hold:
A
120.5
B
'x'
C
120
D
abc
5) In Java, which of the following is not a numerical type?
A
byte
B
double
C
int
D
char
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
double MAX_LENGTH = 99.98;
C
final double MAX_LENGTH = 99.98;
D
none of the above
8) Which of the following is the correct way to declare a variable?
A
int length width;
B
int length; width;
C
int length, int width;
D
int length, width
9) What is the result of 45 / 4?
A
12
B
11
C
11.25
D
10
10) Which of the following expression results in a value 1?
A
15 % 4
B
37 % 6
C
25 % 5
D
2 % 1
11) 25 % 1 is _____
A
2
B
3
C
1
D
0
12) To declare an int variable number with initial value 2, you write ___________
A
int number = 2;
B
int number = 2.0;
C
integer number = 2;
D
int number = 2L;
13) The expression 4 + 20 / (3 - 1) * 2 is evaluated to ______________
A
4
B
20
C
24
D
9
14) Suppose x is 1. What is x after x += 2?
A
3
B
4
C
1
D
-1
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
final
B
numbers#text
C
_thisDog
D
95miles
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?