假设有一个类的所有构造函数声明为private。 例如: public class This {
private This() { }
public someMethod(){
// something here
}
// some more-- no other constructors
}
据我所知,使所有构造函数私人类似于声明类“这种
我有一些继承问题。 我有类似的东西 文件a.php只会 namespace Main;
class A{
public function __construct(){ echo 'A->__construct'; }
}
和文件B.php namespace Main;
class B extends \Main\A{
/* if I write this const
我有一个backbone-extend.js文件,我加载在app.js中的require定义。它有一个Backbone.View扩展器类,定义了一些辅助方法。其中两种方法在我的视图中工作得很好,其中一种总是与Uncaught TypeError: Object [object global] has no method 'gotoUrl'错误。为什么只有这一个方法没有定义,但其他两个工作正常?你看