English

Given below is a real-life case. Class name: City Name two objects of this class. Also name two data and two methods of this class.

Advertisements
Advertisements

Question

Given below is a real-life case.

Class name: City

Name two objects of this class. Also name two data and two methods of this class.

Very Short Answer
Advertisements

Solution

Two objects of this class are:

  1. Delhi
  2. Mumbai

Two data members of this class are:

  1. cityName
  2. population

Two methods of this class are:

  1. displayDetails()
  2. showPopulation()
shaalaa.com
  Is there an error in this question or solution?
Chapter 2: Class as the Basis of all Computation - Exercises [Page 65]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 2 Class as the Basis of all Computation
Exercises | Q 4. (iv) | Page 65
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×