如果你想要自动加载类,下面哪种函数声明是正确的?()
A: functionautoload($class_name)
B: function__autoload($class_name,$file)
C: function__autoload($class_name)
D: function_autoload($class_name)
E: functionautoload($class_name,$file)
A: functionautoload($class_name)
B: function__autoload($class_name,$file)
C: function__autoload($class_name)
D: function_autoload($class_name)
E: functionautoload($class_name,$file)
举一反三
- 如何声明一个PHP的用户自定义类() A: <?phpclass Class_name(){}?> B: <?Function Function_name{}?> C: <?class Class_name{}?> D: <?Function Function_name(){}?>
- Python中类的定义正确的是 A: class Phone: name = "" call(self, name) print(name, "打电话") B: class Phone: name = "" call(self, name) print(name, "打电话") C: class Phone: name = "" def call(self, name): print(name, "打电话") D: class Phone name = "" def call(self, name): print(name, "打电话")
- 以下有关类的声明,正确的是 A: class Student(object) def __init__(self, name, score): self.name = name self.score = score B: class Student(object) def __init__(self, name, score) self.name = name self.score = score C: class Student(object): def __init__(self, name, score): self.name = name self.score = score D: class Student(object): def __int__(self, name, score): self.name = name self.score = score
- 以下代码中,实例方法定义正确的是() A: class Student: def setName(self,name): self.name=name B: class Student: def setName(name): self.name=name C: class Student: def setName(self): self.name=name D: class Student: def setName(name,self): self.name=name
- 有如下定义struct person{char name[9];int age;};struct person class[10]={"John",17,"paul",19,"Mary",18,"Adam",16,};则能输出字母M的语句是( )。 A: cout<<class[3].name; B: cout<<class[3].name[1]; C: cout<<class[2].name[1]; D: cout<<class[2].name[0];