Log in
Sign up for FREE
arrow_back
Library
Syntax/Output and Variable Test
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated about 2 years ago
20 questions
Add this activity
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Question 1
1.
Question 2
2.
Question 3
3.
Question 4
4.
Question 5
5.
Question 6
6.
Question 7
7.
Question 8
8.
Question 9
9.
Question 10
10.
Question 11
11.
Question 12
12.
Question 13
13.
Question 14
14.
Question 15
15.
Question 16
16.
Question 17
17.
Question 18
18.
Question 19
19.
Question 20
20.
What is the output by the code below?
System.out.println( 3 + " " + 3 );
3
6
6 6
3 3
3" "3
What is the ASCII value of a space?
36
65
48
32
97
Which of the following would print one backslash on the screen if used in a print( ) or println( )?
\\\
/\
\b
\
\\
What is output by the following code?
System.out.println(""+3+4+5);
39
there is no output due to a compile error
75
12
345
What is the output by the code below?
System.out.println("Hello ");
System.out.print("people ");
System.out.println("everywhere ");
Hellopeopleeverywhere
Hello
people everywhere
Hello
people
everywhere
Hello people everywhere
What is output by the following code?
System.out.println(3+4+""+5*3);
36
757575
715
12
there is no output due to a compile error
What is the output by the code below?
int num = 5;
System.out.println("num");
num: 5
num
num = 5
5
num 5
What is the output by the code below?
System.out.println( "\"9" );
\"9
"9
9
99
\
What is the output by the code below?
char c = 65;
System.out.println(c);
A
65
0
a
c
Which of the following lines correctly defines a char variable?
char = a;
char ‘a’;
char = ‘a’;
char c = ‘a’;
char c = a;
Which of the following can be used to comment code in Java?
{*
[
}*
//
(
Which of the following is the tab character?
\r
\b
\t
\nl
\n
Which of the following lines correctly defines a String variable?
String s = cdef;
String = "cdef";
String s = "cdef";
String;
s = "cdef";
What of the following is not a legal reserved word for a java data type?
float
char
short
integer
double
What is the output by the code below?
int cost = 2.65;
System.out.println("Price: " + cost);
Price:
There is no output due to a error.
Price: 2.65
2.65
What is the output by the code below?
String s = "aplus";
System.out.println( s );
sulpa
s
aplus
plus
aplu
In Java, every program statement ends with a what ?
;
(
\
{
}
Every method must have an open and close what?
bracket
brace
period
chickens
semicolon
What is the output by the code below?
System.out.print( "ap\\lus" );
ap\lus
aplus
apl
us
apl\us
Which of the following is a 32 bit data type?
int
char
double
long
short