Java Interview Questions
Q61. Constructors have the same name as the ________
(a) Class
(b) Int
(c) Void
(d) String
Answer: (a) Class
Q62. Method __________ has same name but different parameter list and different definition
(a) Binding
(b) Overriding
(c) Overloading
(d) Polymorphism
Answer: (c) Overloading
Q63. Polymorphism in Java is of two tytpes, namely ________ and _______
(a) Static type, Dynamic type
(b) Start time, End time
(c) Run time, Compile time
(d) Variable type, Static type
Answer: (c) Run time, Compile time
Q64. Runtime polymorphism is also known as _______
(a) Static binding
(b) Early binding
(c) Dynamic method dispatch
(d) Method overloading
Answer: (c) Dynamic method dispatch
Q65. When reference variable of Parent class refers to the object of Child class, then it is known as
(a) Side casting
(b) Upcasting
(c) Top casting
(d) Downcasting
Answer: (b) Upcasting
Q66. Polymorphism that is resolved during compiler time is known as
(a) Dynamic polymorphism
(b) Static polymorphism
(c) Special Polymorphism
(d) None of the above
Answer: (b) Static polymorphism
Q67. Which one of the followings is false for static method
(a) They can only call other static methods
(b) They can only access static data
(c) They can only access static data
(d) They can only access dynamic data
Answer: (d) They can only access dynamic data
Q68. In inheritance, the old class is known as
(a) Start class
(b) Base class
(c) Derived class
(d) Sub class
Answer: (b) Base class
Q69. Base class is also known as
(a) Super class
(b) Child class
(c) Sub class
(d) Derived class
Answer: (a) Super class
Q70. When a class extends a class, which extends another class then this is called ______ inheritance
(a) Single level
(b) Two level
(c) Multi level
(d) Many level
Answer: (c) Multi level
Q71. When more than one child classes have the same parent class then it is called as
(a) Single inheritance
(b) Multilevel inheritance
(c) Class inheritance
(d) Hierarchical inheritance
Answer: (d) Hierarchical inheritance
Q72. A class that cannot be subclassed is called a _______
(a) Parent class
(b) Child class
(c) Revised class
(d) Final class
Answer: (d) Final class
Q73. Class Subclass-name extends Superclass-name
{
//methods and fields
}
This syntax is used for
(a) Inheritance
(b) Polymorphism
(c) Encaptulation
(d) All of the above
Answer: (a) Inheritance
Q74. _________ classes cannot be instantiated
(a) String
(b) Mutable
(c) Wrapper
(d) Abstract
Answer: (d) Abstract
Q75. ______ is a process of hiding the implementation details and showing only functionality to the user
(a) Abstract
(b) Network
(c) System
(d) Anonymous
Answer: (a) Abstract
Practice Test Exam