NEW
Font size
WorksheetsJava Programming Quizz-GX
Total questions: 25
Worksheet time: 13mins
Which of the following is a comment in the Java language?
/ comment /
/* comment */
/ comment */
<-- comment -->
Which of the following is the correct main() method signature in Java?
public static void main (String [] args)
public static void Main (String [] args)
public static void main (string [] args)
public static void main (String args)
Which of the following is a valid variable declaration in Java?
int 1myInteger = 0;
int int = 0;
Int my Integer = 0;
int myInteger = 0;
Which Java data type is used to store 64-bit floating-point numbers?
int
long
float
double
What is the problem with this code?
Line 1: String myName = "Mary Jacobson";
Line 2: System.out.println ("My name is " + myname);
Line 2: should be System.out.println ("My name is myName");
Line 2: should be System.out.println ("My name is " + myName);
Line 2: should be System.out.display("My name is " + myname);
There is no problem with the code
What is pseudocode?
A simple java-like programming language
Statements in plain English
A control structure used in Java
A java class
What will be the output?
24
32
23
32
Which example shows the correct syntax for a while loop?
If the value of inputtedNum is 6, then what is the output of the following code?
<no output>
The sun will shine bright
The moon will glow bright
Error
Which control flow statement is represented by a diamond shape in a flowchart diagram?
while
if
do while
none
How would you describe a while loop?
Check the condition; if it is true, then run a code block. Otherwise, run a different code block.
Check whether the condition is true; if it is true, then keep repeating until the condition is false.
Run a block of code and then check the condition; if the condition is true, then repeat the block of code.
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
What is at the end of a line of code?
#
;
)
>
A variable that holds a whole number?
String
Boolean
Int
Float
A variable that holds words?
String
Boolean
Int
Float
A variable that holds a decimal number?
String
Boolean
Int
Float
A data type that deals with logical values?
Boolean
Cast Operator
Character String
Class
Comments that are enclosed between /* and /. The compiler ignores anything that appears between / and */...
Single-line comments
Multiple-line comments
comments
A variable that holds a character?
String
Boolean
Int
Char
Which of this command is the correct way of printing in Java?
System.Out.print
System.out.Print
System.out.print
system.out.print
Name the data type: '3'
int
char
string
None of the above
