Syntax/Output and Variable Test
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
20 Questions
1 point
1
Question 1
1.
What is the output by the code below? System.out.println( 3 + " " + 3 );
What is the output by the code below?
System.out.println( 3 + " " + 3 );
1 point
1
Question 2
2.
What is the ASCII value of a space?
What is the ASCII value of a space?
1 point
1
Question 3
3.
Which of the following would print one backslash on the screen if used in a print( ) or println( )?
Which of the following would print one backslash on the screen if used in a print( ) or println( )?
1 point
1
Question 4
4.
What is output by the following code? System.out.println(""+3+4+5);
What is output by the following code?
System.out.println(""+3+4+5);
1 point
1
Question 5
5.
What is the output by the code below?System.out.println("Hello ");System.out.print("people ");System.out.println("everywhere ");
What is the output by the code below?
System.out.println("Hello ");
System.out.print("people ");
System.out.println("everywhere ");
1 point
1
Question 6
6.
What is output by the following code? System.out.println(3+4+""+5*3);
What is output by the following code?
System.out.println(3+4+""+5*3);
1 point
1
Question 7
7.
What is the output by the code below?int num = 5;System.out.println("num");
What is the output by the code below?
int num = 5;
System.out.println("num");
1 point
1
Question 8
8.
What is the output by the code below?System.out.println( "\"9" );
What is the output by the code below?
System.out.println( "\"9" );
1 point
1
Question 9
9.
What is the output by the code below?char c = 65;System.out.println(c);
What is the output by the code below?
char c = 65;
System.out.println(c);
1 point
1
Question 10
10.
Which of the following lines correctly defines a char variable?
Which of the following lines correctly defines a char variable?
1 point
1
Question 11
11.
Which of the following can be used to comment code in Java?
Which of the following can be used to comment code in Java?
1 point
1
Question 12
12.
Which of the following is the tab character?
Which of the following is the tab character?
1 point
1
Question 13
13.
Which of the following lines correctly defines a String variable?
Which of the following lines correctly defines a String variable?
1 point
1
Question 14
14.
What of the following is not a legal reserved word for a java data type?
What of the following is not a legal reserved word for a java data type?
1 point
1
Question 15
15.
What is the output by the code below?int cost = 2.65;System.out.println("Price: " + cost);
What is the output by the code below?
int cost = 2.65;
System.out.println("Price: " + cost);
1 point
1
Question 16
16.
What is the output by the code below?String s = "aplus";System.out.println( s );
What is the output by the code below?
String s = "aplus";
System.out.println( s );
1 point
1
Question 17
17.
In Java, every program statement ends with a what ?
In Java, every program statement ends with a what ?
1 point
1
Question 18
18.
Every method must have an open and close what?
Every method must have an open and close what?
1 point
1
Question 19
19.
What is the output by the code below? System.out.print( "ap\\lus" );
What is the output by the code below?
System.out.print( "ap\\lus" );
1 point
1
Question 20
20.
Which of the following is a 32 bit data type?
Which of the following is a 32 bit data type?