Page 356 - CA_Blue( J )_Class10
P. 356
2. The wrapping up of data members and member methods together into a single unit is called ………………….
a. Polymorphism b. Encapsulation
c. Abstraction d. All of these
3. Which of the following can be used to control the visibility of the parts of a class?
a. Access specifiers b. Class
c. Object d. Polymorphism
4. Which of the are known as class variables?
a. Static Data Members b. Non-Static Data Members
c. Local variables d. Instance variables
5. Which of the following is a sequence of statements within curly brackets?
a. Section b. Method
c. Block d. Both a and c
6. Which of the following is a wrapper class in Java?
a. String b. Integer
c. ArrayList d. Scanner
7. What is the purpose of wrapper classes in Java?
a. To wrap primitive data types into objects b. To provide methods for mathematical operations
c. To manipulate strings efficiently d. To handle input/output operations
8. Which wrapper class represents characters in Java?
a. String b. Character
c. Integer d. Double
9. What is the method used to convert a string to an integer using the Integer wrapper class?
a. parseInt() b. valueOf()
c. toString() d. intValue()
10. Which of the following methods is used to convert an integer to a string using the Integer wrapper class?
a. parseInt() b. valueOf()
c. toString() d. intValue()
Answers
1. c 2. b 3. a 4. a 5. c 6. b 7. a 8. b 9. a 10. c
B. Fill in the blanks.
1. If the data members are preceded by the access specifier …………………, then the data members and the member methods can be
accessed within the class only.
2. ………………… are name given to a memory location to store values.
3. In Java, ………………… is the method which allows one class to inherit the properties of another class.
4. When the derive class is inherited from one superclass, then the type of inheritance is termed as ………………….
5. When ………………… type of inheritance is coded together, then it is termed as hybrid inheritance.
Answers
1. private 2. Variables 3.Inheritance 4. single inheritance 5. more than one
C. Answer the following questions:
1. Define encapsulation.
Ans. The wrapping up of data members and member methods together into a single unit is called encapsulation.
2. What is access specifier?
Ans. An access specifier is a property that controls the accessibility of data members and member methods within the class or outside
the class.
3. Name the three types of access specifiers.
Ans. The three types of access specifiers are private, public and protected.
354354 Touchpad Computer Applications-X

