下列选项中,与class Person等价的是()
举一反三
- 下列选项中,与class Person等价的是( )。知识点:继承 A: class Person(Object) B: class Person(object) C: class Person: Object D: class Person: object
- python中,下列哪种语法表示Student从Person中继承。( ) A: class Student: Person B: class Student extends Person C: class Student (Person) D: class Student: class Person
- 阅读下列的程序 class Person{ static{ System.out.println("static") } Person(){ System.out.println("构造") } } class Demo{ public static void main(String[] args){ Person p = new Person(); } } 下列选项中,程序的运行结果是()
- 定义一个类Person,不想让其他类继承该类Person,下列书写正确的是( ) A: private class Person{… …} B: protected class Person{… …} C: public final class Person{… …} D: class Person{… …}
- 阅读下面的代码: class Person{ void say(){ System.out.println("hello"); } } class Example{ public static void main(String[] args){ Person p1 = new Person(); Person p2 = new Person(); p2.say(); p1.say(); p2=null; p2.say(); } } 下列选项中,哪个是程序的输出结果?()