定义一个类Person,不想让其他类继承该类Person,下列书写正确的是( )
A: private class Person{… …}
B: protected class Person{… …}
C: public final class Person{… …}
D: class Person{… …}
A: private class Person{… …}
B: protected class Person{… …}
C: public final class Person{… …}
D: class Person{… …}
举一反三
- 下列选项中,与class Person等价的是( )。知识点:继承 A: class Person(Object) B: class Person(object) C: class Person: Object D: class Person: object
- 如何在PHP中自定义一个类PERSON A: function PERSON { //...... } B: function PERSON (){ //...... } C: class PERSON{ //...... } D: class PERSON(){ //...... }
- 下面声明正确的是( )。 A: abstract final class Student{} B: public abstract class Student{} C: class Student extends Person,Parent{} D: private class Person{}
- python中,下列哪种语法表示Student从Person中继承。( ) A: class Student: Person B: class Student extends Person C: class Student (Person) D: class Student: class Person
- (6-9)定义了如下Person类,下面程序段能够正确初始化Person数组。 class Person{ private String name; public Person(String name){ this.name=name; } }