By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

implementation abstract function

P: n/a
What is true:

The classes are defined as follows:
abstract class BaseCls{
protected abstract function getName();
}

class ChildCls extends BaseCls{
}

What is following implementations of getName() is invalid in ChildCls?

1) protected function getName(){}
2) function getName(){}
3) private function getName(){}
4) public function getName(){}

And why.

Thank you!
Aug 21 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
..oO(Andrew G. Koptyaev)
>What is true:

The classes are defined as follows:
abstract class BaseCls{
protected abstract function getName();
}

class ChildCls extends BaseCls{
}

What is following implementations of getName() is invalid in ChildCls?

1) protected function getName(){}
2) function getName(){}
3) private function getName(){}
4) public function getName(){}
Why not simply try it?
>And why.
PHP explains the why in its error message.

Micha
Aug 21 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.