[php] Interface abstract里面的私有方法 -- private method of interface and abstract class
2010-06-02 16:43
393 查看
interface AInf { private function hiddenMethod(); } class MyClass implements AInf {}
When running the code, we will get to error:
Fatal error: Access type for interface method AInf::hiddenMethod() must be omitted in XXXX
So, there is no way to define a private in the interface.
How about private method in abstract class?
abstract class AAbs { private function hiddenMethod(){} } class MyClass extends AAbs {}
It doesn't course a anything of error or waring! But in fact that, there is not useful, because extended class can't see it/them anyway.
相关文章推荐
- A better understanding of java abstract class and interface
- 【JavaLearning】接口与抽象类的比较(The comparison of Interface and Abstract Class )
- abstract class and interface
- Java Abstract class and Interface
- 接口与抽象类 (interface and abstract class)
- PHP JSON出错:Cannot use object of type stdClass as array解决方法
- PHP JSON出错:Cannot use object of type stdClass as array解决方法
- A rule of thumb about Interface vs Abstract Class
- Programming in Java: Multi-threads and interface vs abstract class
- java abstract class and interface 讨论
- What is difference between abstract class and interface
- 【转载】#446 - Deciding Between an Abstract Class and an Interface
- 学习日志-abstract class and interface
- php “Cannot use object of type stdClass as array” 的解决方法
- Python - base class and the AbstractMethod/Abst...
- difference between abstract class and interface
- Programming in Java: Multi-threads and interface vs abstract class
- Interface And Abstract Class
- Java - Difference between Abstract class and Interface
- Interface and Abstract Class 区别