WorksheetsJavaLab-2Quiz
Total questions: 21
Worksheet time: 9mins
What type of language is Java?
Object Oriented
Scripting
Assembly
Pseudocode
Which keyword is used to create an object in Java?
create
object
new
make
What is the correct way to declare a variable of type double in Java?
double variableName
boolean variableName
String variableName
int variableName
What is the correct way for storing WHOLE numbers in Java?
float num = 5.0
int num = 5;
double num = 5.0
string num = "5";
What is the output of z?
int x = 5;
int y = 2;
int z = x/y;
2.5
2.50
2
ERROR
Which of the following data types stores characters in Java?
int
double
char
boolean
What is a correct syntax to output "Hello World" in Java?
System.out.println("Hello World");
Console.WriteLine("Hello World");
echo("Hello World");
print ("Hello World");
How do you insert COMMENTS in Java code?
// This is a comment
# This is a comment
/* This is a comment
Which data type is used to create a variable that should store text?
String
string
Txt
myString
Which operator can be used to compare two values?
==
=
<>
><
Select wrong identifier in JAVA
all_member
_$_$
total123
123total
Size of BYTE datatype
2 byte
8-bits
4 byte
8 byte
Java program does not run without below function
user()
system()
main()
void()
A ___________ file is created after successful compilation of a Java program.
Object file
Array file
Class file
String file
Command to compile Java program
javax
javay
javac
Java
Command to run a Java program
javaa
java
jaava
jaavaa
JDK stands for
Java Developer Kit
Java Development Kit
Java Design Kit
Java Debugging Kit
JRE stands for
Java Run Environment
Java Run Execution
Java Runtime Environment
Java Ready Execution
How do you create a variable with the floating number 2.8?
byte x = 2.8f
float x = 2.8f;
x = 2.8f;
int x = 2.8f;
Which keyword is used to import a package from the Java API library?
lib
import
getlib
package
Which statement is true about java ?
Java is a sequence-depended programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
