KnowledgeBoat Logo
|

Computer Applications

Consider the below picture and choose the correct statement from the following:

Fruit is the object and Apple, Guava, Orange are classes. Fruit and Apple, Guava, Orange are classes. Practice Test ICSE Computer Applications Class 10.

Objects & Classes

2 Likes

Answer

Fruit is the class and Apple, Guava, Orange are objects.

Reason — In object-oriented programming (OOP), a class is a blueprint or template that defines the properties and behaviours (methods) of objects. An object is an instance of a class that holds specific data defined by the class.

In this case:

  • Fruit represents the class because it defines the general properties, and methods common to all fruits (e.g., colour, taste, season, etc).
  • Apple, Guava and Orange are specific examples or instances of fruits making them objects created from the Fruit class.

Answered By

1 Like


Related Questions