Tuesday, July 13, 2021

Java Quiz-2

Java Multiple Choice Questions


1. Java is developed by ____________________.

A.Sun Microsystems
B.Adobe
C.Microsoft
D.Facebook


2. ___________ is one of the java features that enables java program to run anywhere anytime.

A.Object-Oriented
B.Multithreading
C.Platform-Independent
D.Case Sensitive


3. Java compiler translates source code into _____________

A. Bytecode (Virtual Machine Code)
B.Bitcode
C.Machine level code
D.none


4. input .java file is compiled into ____________ file as output by java compiler.

A..exe
B..jar
C..class
D..out


5. The name of the Java Compiler is______________.

A.Turbo Java
B.javac
C.java
D.jvm


6. What is a feature of Java Programming Language?

A.Security and Case-Sensitive
B.Architectural neutral and Platform independent
C.Multithreading and Automatic Garbage Collection
D.all of the above


7. Java is a _____________ programming language.

A.interpreted
B.compiled
C.interpreted and compiled both
D.translated


8. What is true about Class in java?

A.A class has attributes and methods
B.A Class can be considered as factory for producing the objects having same attributes and methods with different states
C.A Class can be declared with public or default modifier
D.All of the above


9. Which of the following is not assignment operator?

A.+=
B.==
C.%=
D.=


10. __________ variables and methods can be called without using the objects

A.static
B.final
C.abstract
D.public


11. Which of the following statements is true?

A.Java supports operator overloading
B.Java supports interfaces
C.Java supports pointers
D.Java supports multiple inheritance


12. __________ is a special method in java that enables an object to initialize itself when it is created

A.new()
B.this()
C.constructor
D.super()


13. ______ is an implicit reference created by the runtime itself referring to the current object itself.

A.super
B.this
C.that
D.new


14. We cannot create a subclass of _________ class.

A.abstract
B.static
C.final
D.private


15. ________ allows to dynamically allocate memory for the object on heap space and create object reference on the heap stack.

A.this keyword
B.new keyword
C.constructor
D.main() method