Syntax/Output and Variable Test

By Mickey Arnold
Last updated 10 months ago
20 Questions

What is the output by the code below?
System.out.println( 3 + " " + 3 );

What is the ASCII value of a space?

Which of the following would print one backslash on the screen if used in a print( ) or println( )?

What is output by the following code?
System.out.println(""+3+4+5);

What is the output by the code below?
System.out.println("Hello ");
System.out.print("people ");
System.out.println("everywhere ");

What is output by the following code?
System.out.println(3+4+""+5*3);

What is the output by the code below?
int num = 5;
System.out.println("num");

What is the output by the code below?
System.out.println( "\"9" );

What is the output by the code below?
char c = 65;
System.out.println(c);

Which of the following lines correctly defines a char variable?

Which of the following can be used to comment code in Java?

Which of the following is the tab character?

Which of the following lines correctly defines a String variable?

What of the following is not a legal reserved word for a java data type?

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?
String s = "aplus";
System.out.println( s );

In Java, every program statement ends with a what ?

Every method must have an open and close what?

What is the output by the code below?
System.out.print( "ap\\lus" );

Which of the following is a 32 bit data type?