PDA

View Full Version : Partial Class Definition -- Help!! --


interkrome
01-12-2007, 05:11 AM
class A1
{ var $attribute1;
function operation1()
....}

class A2 extends A1
{ var $attribute2;
function operation2()
....}

$b=newA2();
$a=newA1();


the above code represents?
a. polymorphism
b. relationship
c. inheritance
d. class abstraction

all of the following accesses would be valid except?
a.$b->operation1();
b.$b->attribute1=10;
c.$a->operation1();
d.$a->operation2();
e.$b->attribute1=10;

Roelf
01-12-2007, 08:41 AM
this smells like homework to me.

check your book to see what "extends" exactly does. Which methods and members are accessible from a an b?

interkrome
01-12-2007, 09:25 AM
i need someone who can explain everything about the question with easy example.i do really want to know what is polymorphism, relationship, inheritance, class abstraction. I'm not a student anymore. i'm a job hunter.