Which of the following are legal Java identifier names? Select all that apply. a
ID: 3560992 • Letter: W
Question
Which of the following are legal Java identifier names? Select all that apply.
a. counter1
b. $index
c. name-7
d. Iterator.Class
e. array
2. [] Examine the following set of tokens:
goto unsigned class
switch null double
label transient template
Which of the following statements are true? Select all that apply.
a. template and unsigned are not reserved words
b. All of the words in the list are reserved words.
c. label is not a reserved word
3. [] The Java Programming language defines operators for string concatenation. (T/F)
4. [] Examine the following set of operators
&& || & |
Which of the following statements are true? Select all that apply.
a. All of the operators are logical operators.
b. These operators can be applied only to boolean values.
c. The operator || evaluates its right argument only if the left argument evaluates to false.
d. The operators || and | perform and exclusive OR operation.
e. The operator & evaluates its right argument regardless of the left argument.
5. [] Examine the following lines of code:
for (a = 0; a < 3; a++)
{
if (a == 1)
continue;
for (b = 0; b < 3; b++)
{
if (b == 1)
break;
System.out.prntln(a + ", " + b );
}
}
Which of the following lines are included in the output? Select all that apply
a. 0, 0
b. 0, 1
c. 0, 2
d. 1, 0
e. 0, 0
f. 1, 2
g. 2, 0
h. 2, 1
i. 2, 2
8. Which of the following does not contain a syntax error?
a. System.out.println( 'Hello world!' ):
b. System.out.println( "Hello
world!" );
c. System.out.println( "Hello world!" );
d. System.out.println( Hello world! );
9. Which of the following is not a Java primitive type?
a. char
b. byte
c. real
d. double
10. Which of the following is not a valid Java identifier?
a. my Value
b. $_AAA1
c. width
d. m_x
Explanation / Answer
1. a,b,e
2. a,c
3. T
4. c,d
5. a,e,g
8. c
9. c
10. a
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.