WorksheetsJAVA_QUIZ_1
Total questions: 77
Worksheet time: 1hrs 17mins
Name
Class
Date
1.
Who developed Java?
a)
Microsoft
b)
Sun Microsystems
c)
Oracle
d)
IBM
2.
In which year was Java first released?
a)
1991
b)
1995
c)
2000
d)
1998
3.
What was the original name of Java?
a)
Oak
b)
Pine
c)
Maple
d)
Cedar
4.
Which project led to the creation of Java?
a)
Blue Project
b)
Green Project
c)
Red Project
d)
Yellow Project
5.
Java is a ___ language.
a)
Platform dependent
b)
Machine dependent
c)
Platform independent
d)
Assembly language
6.
Which feature of Java makes it portable?
a)
Bytecode
b)
Pointers
c)
Libraries
d)
Threads
7.
JVM stands for?
a)
Java Variable Machine
b)
Java Virtual Machine
c)
Java Verified Machine
d)
Joint Virtual Machine
8.
JDK stands for?
a)
Java Development Kit
b)
Java Deployment Kit
c)
Java Design Kit
d)
Java Debug Kit
9.
JRE stands for?
a)
Java Runtime Environment
b)
Java Real Environment
c)
Java Ready Environment
d)
Java Run Engine
10.
Which component compiles Java code?
a)
JVM
b)
JRE
c)
javac
d)
java
11.
Which component runs Java bytecode?
a)
JRE
b)
JVM
c)
javac
d)
Compiler
12.
Which memory management system is used in Java?
a)
Manual
b)
Pointers
c)
Garbage Collection
d)
Stack Allocation
13.
Which is not an OOP principle?
a)
Encapsulation
b)
Polymorphism
c)
Compilation
d)
Inheritance
14.
Encapsulation means?
a)
Data hiding
b)
Data exposing
c)
Data deleting
d)
Data sharing
15.
Polymorphism means?
a)
Many forms
b)
One form
c)
No form
d)
Two forms
16.
Inheritance allows?
a)
Code reuse
b)
Code deletion
c)
Code hiding
d)
Code blocking
17.
Abstraction means?
a)
Showing details
b)
Hiding details
c)
Deleting details
d)
Copying details
18.
Which keyword is used to define a class?
a)
define
b)
struct
c)
class
d)
object
19.
Which keyword makes a method accessible everywhere?
a)
private
b)
protected
c)
public
d)
static
20.
Which keyword allows method call without object?
a)
final
b)
abstract
c)
static
d)
public
21.
What is the entry point of a Java program?
a)
start()
b)
main()
c)
run()
d)
init()
22.
What is the return type of main method?
a)
int
b)
void
c)
float
d)
double
23.
Which parameter is used in main method?
a)
String args
b)
String[] args
c)
int args
d)
char args
24.
Which keyword prevents inheritance?
a)
static
b)
final
c)
private
d)
abstract
25.
Identifiers cannot start with?
a)
Letter
b)
Digit
c)
_
d)
$
26.
Which is a valid identifier?
a)
1name
b)
_name
c)
@name
d)
#name
27.
Which is not a Java keyword?
a)
class
b)
static
c)
define
d)
public
28.
Which data type is used for integers?
a)
float
b)
int
c)
double
d)
char
29.
Which data type stores decimal values?
a)
int
b)
float
c)
boolean
d)
char
30.
Which data type stores true/false?
a)
int
b)
boolean
c)
char
d)
float
31.
Size of int in Java?
a)
2 bytes
b)
4 bytes
c)
8 bytes
d)
1 byte
32.
Size of char in Java?
a)
1 byte
b)
2 bytes
c)
4 bytes
d)
8 bytes
33.
Which operator is used for addition?
a)
+
b)
-
c)
*
d)
/
34.
Which operator is used for comparison?
a)
+
b)
=
c)
==
d)
%
35.
Which operator is logical AND?
a)
&
b)
&&
c)
|
d)
||
36.
Which operator is logical OR?
a)
|
b)
||
c)
&
d)
&&
37.
Which operator is used for remainder?
a)
%
b)
/
c)
*
d)
+
38.
Which statement is used for decision making?
a)
for
b)
while
c)
if
d)
switch
39.
Which loop runs at least once?
a)
for
b)
while
c)
do-while
d)
if
40.
Which loop is best when number of iterations is known?
a)
for
b)
while
c)
do-while
d)
switch
41.
Which statement is used for multiple conditions?
a)
if
b)
else
c)
switch
d)
for
42.
Which keyword exits loop?
a)
stop
b)
break
c)
exit
d)
return
43.
Which keyword skips current iteration?
a)
skip
b)
continue
c)
pass
d)
break
44.
Command line arguments are stored in?
a)
int[] args
b)
String[] args
c)
char[] args
d)
float[] args
45.
System is a class in which package?
a)
java.io
b)
java.lang
c)
java.util
d)
java.net
46.
out is an object of?
a)
System
b)
PrintStream
c)
Scanner
d)
InputStream
47.
println() method belongs to?
a)
System
b)
PrintStream
c)
Scanner
d)
JVM
48.
Which package is imported by default?
a)
java.io
b)
java.lang
c)
java.util
d)
java.net
49.
Garbage collection removes?
a)
Unused objects
b)
Variables
c)
Methods
d)
Classes
50.
Java uses which memory for objects?
a)
Stack
b)
Heap
c)
Register
d)
Cache
51.
Which memory stores local variables?
a)
Heap
b)
Stack
c)
ROM
d)
Disk
52.
Which keyword is used to create object?
a)
new
b)
create
c)
make
d)
object
53.
Which symbol ends a statement in Java?
a)
.
b)
;
c)
:
d)
,
54.
Java programs are saved with extension?
a)
.class
b)
.java
c)
.exe
d)
.txt
55.
Compiled Java code is stored in?
a)
.java file
b)
.class file
c)
.txt file
d)
.exe file
56.
Which tool runs Java program?
a)
javac
b)
java
c)
jre
d)
jvm
57.
Which is not a primitive data type?
a)
int
b)
float
c)
String
d)
char
58.
Which operator increases value by 1?
a)
++
b)
--
c)
+=
d)
-=
59.
Which operator decreases value by 1?
a)
--
b)
++
c)
*=
d)
/=
60.
Which access specifier is most restrictive?
a)
public
b)
private
c)
protected
d)
default
61.
Which access specifier allows access within package?
a)
public
b)
private
c)
protected
d)
default
62.
Which keyword is used for inheritance?
a)
extends
b)
implements
c)
inherits
d)
using
63.
Which keyword is used to inherit interface?
a)
extends
b)
implements
c)
inherits
d)
using
64.
Which data type is used for characters?
a)
int
b)
char
c)
String
d)
byte
65.
Which operator is used for assignment?
a)
=
b)
==
c)
+
d)
-
66.
Which keyword is used to handle exceptions?
a)
try
b)
catch
c)
throw
d)
final
67.
Which block always executes?
a)
try
b)
catch
c)
finally
d)
throw
68.
Which keyword is used to stop program?
a)
break
b)
exit
c)
return
d)
stop
69.
Which method prints without newline?
a)
print()
b)
println()
c)
printf()
d)
write()
70.
Which method prints with newline?
a)
print()
b)
println()
c)
printf()
d)
write()
71.
Which statement checks multiple values?
a)
if
b)
switch
c)
for
d)
while
72.
Which loop checks condition first?
a)
do-while
b)
while
c)
for
d)
switch
73.
Which keyword is used to define constants?
a)
final
b)
static
c)
const
d)
define
74.
Which class is used to take input from user?
a)
Scanner
b)
System
c)
PrintStream
d)
Input
75.
Which package contains Scanner class?
a)
java.io
b)
java.util
c)
java.lang
d)
java.net
76.
Which keyword is used to import package?
a)
include
b)
import
c)
using
d)
package
77.
Which keyword is used to define package?
a)
package
b)
import
c)
using
d)
include
100 %
