Font size
S
M
L
XL
WorksheetsJava Fundamentals
Total questions: 28
Worksheet time: 14mins
Name
Class
Date
1.
Select all the three types of Java variables
a)
instance
b)
static
c)
local
d)
dynamic
e)
var
2.
It is the super class of all the classes
a)
object
b)
Object
c)
Class
d)
instance
3.
The template or blueprint by which objects are created
a)
object
b)
class
c)
instance
d)
interface
4.
a)
10:20:30:40:50
b)
compilation error
c)
ArrayIndexOutOfBoundsException at line 10
d)
ArrayIndexOutOfBoundsException at line 14
5.
These are the most basic data types in Java
a)
reference type
b)
instance
c)
int
d)
primitive
e)
expression
6.
How do you name a variable?
a)
pascal case
b)
camel case
c)
kebab case
d)
snake case
7.
JVM stands for
a)
Jakarta Virtual Memory
b)
Java Visualize Memory
c)
Java Virtual Machine
d)
Java Visualize Machine
8.
a)
b)
c)
d)
9.
What is the operand used in getting the remainder of two numbers when divided
a)
%
b)
&&
c)
|
d)
/
10.
Which statement is not true about primitive data types
a)
char is a numeric type
b)
String is a primitive data type
c)
char data type has length() method
d)
byte has a minimum value of -128 and a maximum value of 127
11.
a data container that saves the data values during Java program execution
a)
constant
b)
object
c)
variable
d)
class
12.
1 is to int as 12.5 is to ?
a)
float
b)
char
c)
double
d)
long
13.
a)
9 Hello Universe!
b)
10 Hello World!
c)
compilation error
d)
10 Hello Universe!
14.
He is known as the Father of Java
a)
James Gosling
b)
Patrick Naughton
c)
Mike Sheridan
d)
James Bond
15.
Which of the following primitive data type is a 1-bit and has only two values: true and false
a)
char
b)
boolean
c)
String
d)
long
16.
a)
false false
b)
compilation error
c)
true true
d)
false true
17.
This type of loop is executed at least once because condition is checked after loop body.
a)
while loop
b)
enhanced for loop
c)
do-while loop
d)
traditional for loop
18.
What would the new value of a be?
int a = 1;
a++;
a)
2
b)
1
c)
0
d)
3
19.
the only operator that takes three operands
a)
Unary Operator
b)
Assignment Operator
c)
Arithmetic Operator
d)
Ternary Operator
20.
a)
Thursday
b)
compilation error
c)
Thursday Friday Weekend
d)
Thursday Friday Weekend Monday Tuesday Wednesday
21.
a)
1020
b)
compilation error
c)
30
d)
x+y
22.
a)
70
b)
5020
c)
70.0
d)
compilation error
23.
a)
No Output
b)
Friday
c)
compilation error
d)
None of the above
24.
a)
John
b)
compilation error
c)
John Philip
d)
Philip
25.
It is a collection of related classes
a)
group
b)
none of the above
c)
Java project
d)
package
26.
a)
compilation error
b)
A B D E
c)
A B C D E
d)
A C D E
27.
a)
false false
b)
true false
c)
false true
28.
Keyword use to instantiate a class
a)
equals
b)
main
c)
void
d)
new
Reset
