JAVA PROGRAMMING QUIZ QUESTIONS
JAVA PROGRAMMING QUIZ QUESTIONS
a) Default Constructor
b) Parameterized Constructor
c) Both a and b
d) None of the above
A) Interfaces
B) Classes
C) Sub-packages
D) All Mentioned above.
Which of this keyword can be used in a sub class to call the constructor of super class?
a. super
b. this
c. extent
d. extends
_________ is a feature that allows one interface to be used for general class of
actions.
(a) Polymorphism
(b) Inheritance
(c) Encapsulation
(d) Abstraction
Which of the following is called when a method having the same name as that the name of the
class where it is defined?
a. abstract
b. this
c. constructor
d. final
a. HTML
b. Java Virtual Machine
c. Java Application Programming Interface (API)
d. HotJava
Which component is used to compile, debug and execute the java programs?
a) JRE
b) JIT
c) JDK
d) JVM
a) java.io
b) java.util
c) java.applet
d) java.lang
a) Main
b) final
c) While
d) Try
Which of the following is the correct way of importing an entire package ‘pkg’?
a) import pkg.
b) Import pkg.
c) import pkg.*
d) Import pkg.*
a) Dynamic
b) Architecture Neutral
c) Use of pointers
d) Object-oriented
A class can inherit the properties of another class using _______ keyword
a) extend
b) extends
c) extents
d) Extends
What is the process of defining a method in a subclass having same name & type signature as a
method in its superclass?
a) Method overloading
b) Method overriding
c) Method hiding
d) None of the mentioned
What is the process of defining two or more methods within same class that have same name but
different parameters declaration?
a) method overloading
b) method overriding
c) method hiding
d) none of the mentioned
What is the process of defining a method in terms of itself, that is a method that calls itself?
a) Polymorphism
b) Abstraction
c) Encapsulation
d) Recursion
The ____________can be defined as the concept of having more than one constructor with
different parameters so that every constructor can perform a different task.
Answer : Constructor Overloading
A _______ is a blueprint or prototype that defines the variables and methods common to all
objects of a certain kind.
Answer : Class
A _______defines the structure and behavior (data and code) that will be shared by a set of
objects.
Answer : Class
______ class is a class that cannot be instantiated by itself, it needs to be subclassed by another
class to use its properties.
Answer : abstract