STD-12 Computer Textbook Solution CH-08 Classes and Objects in Java
Textbook MCQ with Solution: Chapter 8 Classes and Objects in Java
1. Which of the following defines attributes and methods?
a. Class
b. Object
c. Instance
d. Variable
2. Which of the following keyword is used to declare Class variables and class methods?
a. static
b. private
c. public
d. package
3. Which of the following operator creates an object and returns its reference?
a. dot (.)
b. new
c. colon (:)
d. assignment (=)
4. Which of the following method can be called without creating an instance of a class?
a. Instance method
b. Class method
c. Constructor method
d. All of these
5. Which of the following refers more than one method having same name but different
parameters?
a. Overloaded methods
b. Overridden methods
c. Duplicate methods
d. All of these
6. Which method is invoked automatically with creation of an object?
a. Instance method
b. Constructor
c. Class method
d. All of these
7. Which of the following is the keyword used to refer a superclass constructor in subclass
constructor?
a. extends
b. super
c. name of the superclass
d. new
8. Which of the following is used to invoke an instance method in Java?
a. The name of the object, colon (:) and the name of the method
b. The name of the object, dot (.) and the name of the method
c. The name of the class, colon (:) and the name of the method
d. The name of the class, dot (.) and the name of the method
9. Which of the following is accessible by instance methods?
a. Only instance variables
b. Only class variables
c. Both (A) and (B)
d. None of these (d)
10. When methods in the superclass and subclass have same name and signature, what are
they called ?
a. Overloaded methods
b. Overridden methods (b)
c. Inherited methods
d. All of these
0 comments: