JAVA SOLVED
MCQS FOR UGC NET COMPUTER SCIENCE
1. What is the difference between a class and
object
A. A class represents a collection of objects
B. A class defines the attributes and behavior of
an object
C. An object represents a collection of classes
D. Both class and object are one and the same
Ans.: B
2.
What happens if a class
defines a method with the same name and parameters a method in its super
class
A. The compiler automatically renames the subclass
method
B. The program runs since because overriding
methods is allowed
C. The program throw a duplicate method exception
D. The subclass methods will be ignored.
Ans.: B
3. Which of the following are examples of
polymorphism
A. Method overriding
B. Method overloading
C. Accessors and mutators
D. Both a and b
Ans.: D