Worksheetsambot para asa ni
Total questions: 20
Worksheet time: 14mins
What is a correct syntax to output "Hello World" in Java?
System.out.println("Hello World");
echo("Hello World")
print ("Hello World");
Console.WriteLine("Hello World");
Java is short for "JavaScript"
FALSE
TRUE
Which data type is used to create a variable that should store text?
String
string
Txt
myString
How do you create a variable with the numeric value 5?
int x = 5;
num x = 5
float x = 5;
x = 5;
How do you create a variable with the floating number 2.8?
float x = 2.8f;
byte x = 2.8f
int x = 2.8f;
x = 2.8f;
The value of a string variable can be surrounded by single quotes.
True
False
Which operator can be used to compare two values?
><
==
=
<>
To declare an array in Java, define the variable type with:
[]
{}
()
Which keyword is used to import a package from the Java API library?
import
lib
package
getlib
How do you start writing an if statement in Java?
if (x > y)
if x > y:
if x > y then:
Which statement is used to stop a loop?
tama kana accla
exit
stop
break
single line comment
(a)
multi-line comment
(a)
Create a variable named carName and assign the value Volvo to it.
(a)
If you forget to put a closing quotation mark on a string, what kind error will be raised?
(a)
What is the Java source filename extension
(a)
Java byte code filename extension
(a)
perform mathematical computations and display the result
(a)
Which of the following identifiers are valid?
miles
class
Test
apps
Assign 1.0 to variable radius
(a)
