Elementary Concepts of Objects and Classes

ICSE Class 9 Computer Applications · Solutions for Class 9 ICSE Logix Kips Computer Applications with BlueJ Java · 22 solved questions

Exercise
Marks
11 Mark · Multiple Choice Questions

An object has ...........

Show SolutionHide Solution↓
  • All of these ✓
  • 21 Mark · Multiple Choice Questions

    A class is ...........

    Show SolutionHide Solution↓
  • All of these ✓
  • 31 Mark · Multiple Choice Questions

    ........... represents an entity in the real-world with its identity and behaviour.

    Show SolutionHide Solution↓
  • An object ✓
  • 41 Mark · Multiple Choice Questions

    ........... is a template to create similar objects that share common characteristics and behaviour.

    Show SolutionHide Solution↓
  • A class ✓
  • 51 Mark · Multiple Choice Questions

    The values of an object's ........... represent the state of the object.

    Show SolutionHide Solution↓
  • Attributes ✓
  • 61 Mark · Multiple Choice Questions

    The terms object and ........... are often interchangeable.

    Show SolutionHide Solution↓
  • Instance ✓
  • 1State whether the given statements are True or…

    A class is a specification about the object.
    True

    Solution not available in the source paper.

    2State whether the given statements are True or…

    Only one instance can be created from a single class.
    False

    Solution not available in the source paper.

    3State whether the given statements are True or…

    A class is a user-defined data type.
    True

    Solution not available in the source paper.

    4State whether the given statements are True or…

    Real world objects encapsulate state and behaviour.
    True

    Solution not available in the source paper.

    5State whether the given statements are True or…

    There can be multiple abstraction of the same entity.
    True

    Solution not available in the source paper.

    6State whether the given statements are True or…

    Objects interact with each other through messages.
    True

    Solution not available in the source paper.

    1Assignment Questions

    What are objects? Give five examples.

    Show SolutionHide Solution↓

    Objects are identifiable entities that have a set of attributes, behaviour and state. Five examples of objects are car, pen, mobile, email, bank account.

    2Assignment Questions

    Explain the anatomy of an object.

    Show SolutionHide Solution↓

    Objects are the basic units of an object oriented system. An object is an identifiable entity that has its own set of attributes, behaviour and state. Attributes are individual characteristics that differentiate one object from another. Behaviour is defined by the set of functions or operations an object can perform. State is defined by the set of values held by its attributes.

    3Assignment Questions

    Explain the following statement — "Class is a specification for objects".

    Show SolutionHide Solution↓

    As class describes the common attributes and behaviours of its objects in detail, hence we can say that a class is a specification for objects. It can be viewed as a template or blueprint for multiple objects with similar features.

    4Assignment Questions

    Explain the following statement — "Abstraction is relative to the perspective of the viewer".

    Show SolutionHide Solution↓

    It means that there can be different abstractions of an entity depending on the viewpoint of the user. Lets take the example of a pet dog. From the viewpoint of the dog's owner, the things that are essential for the dog are his favorite food, the colour of his food bowl, his favorite game that he enjoys playing with his owner, his preferred time for walk, etc. From the viewpoint of the dog's vet (doctor for animals), the important things about the dog are whether the dog's body functions are normal or not to ensure that the dog is healthy. Like this, there can be two abstractions for the dog — one for the dog's owner and the other for the dog's vet.

    5Assignment Questions

    Identify five possible attributes and three possible behaviours of the following entities:

    a. School

    Show SolutionHide Solution↓
    AttributesBehaviours
    NameSchool Starts
    AddressSchool gets over
    BoardSchool conducts exams
    Principal 
    Number of Students 
    Number of Teachers 

    b. Student

    AttributesBehaviours
    NameStudy
    AddressPlay
    ClassSleep
    Section 
    Roll No. 

    c. Teacher

    AttributesBehaviours
    NameTeach Class
    School NameConduct Tests
    SubjectMaintain discipline in class
    Class 
    Address 

    d. Computer

    AttributesBehaviours
    ManufacturerStart Computer
    ModelShutdown Computer
    ProcessorRun applications
    RAM 
    Hard Disk 

    e. Television

    AttributesBehaviours
    ManufacturerTurn On
    ModelTurn OFF
    SizeWatch Programmes(Movies, News, Cartoons, etc.)
    Smart 
    Resolution 

    f. Washing Machine

    AttributesBehaviours
    ManufacturerStart Wash
    ModelStop Wash
    CapacityRinse
    Energy Rating 
    Noise Level 

    g. Chair

    AttributesBehaviours
    MaterialBuy
    ColourSell
    WeightSit
    RevolvingRepair
    Price 

    h. Person

    AttributesBehaviours
    First NameEat
    Last NameSleep
    AgeWalk
    Gender 
    Address 
    6Assignment Questions

    Explain in detail how a class is different from an object.

    Show SolutionHide Solution↓

    The class is just a specification of the object. The attributes and methods in the class are thus declarations that do not contain any values. However, the object is a concrete instance of a class with properly defined values for each attribute and behaves as per the methods of the class.

    7Assignment Questions

    Give the reason why a class is known as:

    i. An object factory

    Show SolutionHide Solution↓

    A class is called an object factory because objects are created from the class that contains common attributes and behaviour. The class behaves like a specification for creating such similar objects.

    ii. A composite data type

    A class is composed of member variables which are of different data types. Hence, a class can be viewed as a composite data type.

    iii. A user-defined data type

    The entire data and the code, contained in an object, becomes a user-defined data type using the concept of a class. The class may be considered as a data type and an object as a variable of that data type. For example, once the Bird class has been defined, the statement
         Bird parrot;
    will create a parrot object belonging to the Bird class.

    9Assignment Questions

    What do you understand by the term objects encapsulate state and behaviour?

    Show SolutionHide Solution↓

    An object stores its state in member variables and exposes its behaviour through the member methods. The member methods operate on member variables and serve as the primary mechanism to interact with the object. Only the member methods which are wrapped inside the class can access the data and change its state. Hence, the state and behaviour are said to be encapsulated by the object, hiding internal state and requiring all interaction to be performed through the methods of the object.

    10Assignment Questions

    Explain how objects communicate with each other?

    Show SolutionHide Solution↓

    Objects communicate with each other by sending messages. The sender object requests the receiver object to perform an action.

    Press ↓ to reveal a solution and move to the next question. Back to Solutions for Class 9 ICSE Logix Kips Computer Applications with BlueJ Java.