Object-Orientedness


My Mitsubishi car (ABC123) has four wheels: 0=>'fr',1=>'fl',2=>'rr',3=>'rl'
Variables in class "myCar" are [function,make,wheel,rego]
showMake: I said, myCar is a Mitsubishi.

dumpCar
This is my car
this=[myCar]
varlist=[0=>'function',1=>'make',2=>'wheel',3=>'rego']
0:this%function is [new=>'car',show=>'showMake',display=>'dumpCar']
1:this%make is [=>'Mitsubishi']
2:this%wheel is [0=>'fr',1=>'fl',2=>'rr',3=>'rl']
3:this%rego is [=>'ABC123']


dumpCar
After setRego
this=[myCar]
varlist=[0=>'function',1=>'make',2=>'wheel',3=>'rego']
0:this%function is [new=>'car',show=>'showMake',display=>'dumpCar']
1:this%make is [=>'Mitsubishi']
2:this%wheel is [0=>'fr',1=>'fl',2=>'rr',3=>'rl']
3:this%rego is [=>'XYZ987']

My Boeing plane has two wings: 0=>'left',1=>'right'
Variables in class "myPlane" are [function,make,wing]
showMake: I would say, myPlane is a Boeing.

dumpPlane
This is my plane
this=[myPlane]
varlist=[0=>'function',1=>'make',2=>'wing']
0:this%function is [new=>'plane',show=>'showMake',display=>'dumpPlane']
1:this%make is [=>'Boeing']
2:this%wing is [0=>'left',1=>'right']



Back home