Font size
S
M
L
XL
WorksheetsDr.V.Karuppuchamy, AP/CSE
Total questions: 20
Worksheet time: 10mins
Name
Class
Date
1.
1. Which component is used to compile, debug and execute java program?
a)
a) JVM
b)
b) JDK
c)
c) JIT
d)
d) JRE
2.
2. Which component is responsible for converting bytecode into machine specific code?
a)
a) JVM
b)
b) JDK
c)
c) JIT
d)
d) JRE
3.
3. Which component is responsible to run java program?
a)
a) JVM
b)
b) JDK
c)
c) JIT
d)
d) JRE
4.
4. Which component is responsible to optimize bytecode to machine code?
a)
a) JVM
b)
b) JDK
c)
c) JIT
d)
d) JRE
5.
5. Which line of code will output the string "Hi"?
a)
A. Sys.out.print("Hi");
b)
B. System.out.print("Hi");
c)
C. System.out.print(Hi);
d)
D. System.out.print("Hi")
6.
6. Which line of code will output the sum of 7 and 19?
a)
A. System.out.print(7 + 19);
b)
B. System.out.print("7 + 19");
c)
C. system.out.print(7 + 19);
d)
D. System.out.print(7 + 19)
7.
7. Which of these is used to perform all input & output operations in Java?
a)
a) streams
b)
b) Variables
c)
c) classes
d)
d) Methods
8.
8. System class is defined in .................
a)
A. java.util package
b)
B. java.lang package
c)
C. java.io package
d)
D. java.awt package
e)
E. None of these
9.
9. Which statement is true about java?
a)
a) Platform independent programming language
b)
b) Platform dependent programming language
c)
c) Code dependent programming language
d)
d) Sequence dependent programming language
10.
10. What is the extension of java code files?
a)
a) .class
b)
b) .java
c)
c) .txt
d)
d) .js
11.
11. What is the extension of compiled java classes?
a)
a) .class
b)
b) .java
c)
c) .txt
d)
d) .js
12.
12.In java, how many streams are created for us automatically?
a)
A. 2
b)
B. 3
c)
C. 4
d)
D. 5
13.
13. What will be the output of this code?
a)
A.82 2 3
b)
B.8223
c)
C.822 3
d)
D.822" "3
14.
14. What will be the output of this code?
a)
A.Add2to3
b)
B. Add 2 to 3
c)
C. Add2 to3
d)
D. Add2to 3
e)
Option 5
15.
15. What is the difference between
a)
A.The first code will have outputs on the same line, and the second code will output in separate lines.
b)
B.The two codes are equivalent.
c)
C.The second code is wrong, and will not compile.
16.
16. What will be the output of this code?
a)
A.3.333
b)
B.3
c)
C.4
d)
D.a / b
17.
17. What will be the output of this code?
a)
A.3.333
b)
B.3
c)
C.4
d)
D.a / b
18.
18.Which of these class is superclass of every class in Java?
a)
a) String class
b)
b) Object class
c)
c) Abstract class
d)
d) ArrayList class
19.
19. Which of the following option leads to the portability and security of Java?
a)
a)Bytecode is executed by JVM
b)
b)The applet makes the Java code secure and portable
c)
c)Use of exception handling
d)
d)Dynamic binding between objects
20.
20.-----------------represents an entity in the real world that can be distinctly identified.
a)
a) A Class
b)
b) An object
c)
c)a method
d)
d)A datafield
Reset
