Page 292 - CA_Blue( J )_Class10
P. 292
Answer the following from the above:
1. What is the use of "this.title = title" ?
a. Assign title to the instance variable "title" b. "this" refers to the current object
c. "." is used to access the method "title" d. Both a and b
2. The method void displayDetails()
a. returns the string "Title: " + title + ", Author: " + author + ", Price: Rs." + price
b. Prints "Title: " + title + ", Author: " + author + ", Price: Rs." + price
c. displayDetails() is a method which returns a value
d. None of these
3. From this.price -= discount; we understand
a. Uses a shorthand operator b. increases the amount
c. price is a instance variable d. Both a and c
4. void applyDiscount(double discount)
a. "double discount" is an actual parameter b. "double discount" is a formal parameter
c. discount is an instance variable d. Name of the method is ApplyDiscount
5. From the "static String bookstoreName = "Online Book";" we derive
a. bookstoreName is a instance variable
b. bookstoreName is a class variable
c. Every object of the class BOOK will store Online Book in the variable "bookstoreName"
d. Both a and c
Previous Years' Questions
SECTION A
1. The keyword to create an object of a class is …………………. [2022]
a. create b. new
c. New d. NEW
Ans. b.
2. A ………………… method needs to be called with help of an object. [2022]
a. void b. class
c. non-static d. static
Ans. c.
3. What is meant by a package? Give an example. [2019]
Ans. A package is a collection of related classes and interfaces.
Example: java.io
4. How are private members of a class different from public members? [2018]
Ans.
private members public members
They can be accessed by the methods of the same class. They can be accessed by methods from anywhere within the
class or outside the class.
5. Why is an object called an instance of a class? [2017]
Ans. An object is called an instance of a class as objects are created by a class only and contain all the attributes and behaviour of the
class.
6. Name any two types of access specifiers. [2016]
Ans. public and private are two types of access specifiers.
7. The access specifier that gives the most accessibility is ______ and the least accessibility is ______. [2015]
Ans. public and private
8. Name the keyword which is used to resolve the conflict between method parameter and instance variables/fields. [2015]
Ans. this keyword
290290 Touchpad Computer Applications-X

