KnowledgeBoat Logo

Computer Applications

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

Consider the below picture and choose the correct statement. Polygon is the object and the pictures are classes. Both polygon and the pictures are classes. ICSE 2024 Computer Applications Solved Question Paper.
  1. Polygon is the object and the pictures are classes
  2. Both polygon and the pictures are classes
  3. Polygon is the class and the pictures are objects
  4. Both polygon and the pictures are objects

Objects & Classes

ICSE 2024

20 Likes

Answer

Polygon is the class and the pictures 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:

  • Polygon represents the class because it defines the general structure, properties, and methods common to all polygons (e.g., sides, vertices, perimeter calculation).
  • The pictures are specific examples or instances of polygons, such as triangles, parallelogram, or pentagons, making them objects created from the Polygon class.

Answered By

8 Likes


Related Questions