6. Testing 1
• Create a class named MyCar.
• MyCar has four members viz. _sn, DoorNumber, Color, Run are declared of
type number, number, string, and void function. _sn maked as private.
• Finally, create mycar instance with MyCar class.
2014/1/19
6
11. Testing 2
• Declare a parameterized constructor for MyCar Class. The constructor has
two parameters viz. doorNum, color are declared of type number, string and
inside the constructor their values are assigned to repective properties.
• Finally, create mycar instance with MyCar class.
2014/1/19
11
13. Testing 3
• Create a class named Car.
• Car has a member - Name is declared type of string.
• Declare a parameterized constructor for Car Class. The constructor has a
parameter - name is declared of type string and inside the constructor it
value is assigned to repective property.
• Make MyCar class inherits from the Car class.
• Finally, create mycar instance with MyCar class.
2014/1/19
13