<div> <span>指出以下程序的输出或者错误</span> </div> <pre class="prettyprint lang-cpp">class Person{  Person(){    System.out.println(&quot
发布于 2022-03-03 17:38:24
指出以下程序的输出或者错误
class Person{ Person(){ System.out.println("create person") } public static String getName(){ return"Person" } } class Teacher extends Person{ Teacher(){ System.out.println("create teacher") super() } public static String getName(){ return"Teacher" } } public class Test{ public static void main(String[] args){ Person person = new Person() Person teacher = new Teacher() System.out.println(person.getName()) System.out.println(teacher.getName()) } }
关注者
0
被浏览
21