Advertisements
Advertisements
Question
Consider the above picture and choose the correct statement from the following:
Options
Polygon is the object and the pictures are classes
Both polygon and the pictures are classes
Polygon is the class and the pictures are objects
Both polygon and the pictures are objects
MCQ
Solution
Polygon is the class, and the pictures are objects
Explanation:
The class is a polygon, and its types include triangle, parallelogram, and pentagon. As a result, they fall under the Polygon class.
shaalaa.com
Creating an Object of a Class
Is there an error in this question or solution?