• 2022-06-06
    语句“Person myTest1 = new Person(“张三”,21,60012) ” 与语句“ Person myTest1; myTest1 = new Person(“张三” , 21,60012)”等价。( )
  • 举一反三

    内容

    • 0

      class Person { String name; int age; [br][/br] public Person(String name, int age) { super(); this.name = name; this.age = age; } @Override public boolean equals(Object obj) { Person person=null; if(obj instanceof Person) person=(Person)obj; if(name.equals(person.name)&&age==person.age) return true; return false; } } class Test{ public static void main(String[] args) { Person person1 = new Person("张三", 12); Person person2 = new Person("张三", 12); System.out.println(person1.equals(person2));//运行结果是? } } 程序运行结果是什么? A: true B: false

    • 1

      创建数据库使用以下【】语句。 A: CREATE TABLE mytest B: CREATE DATABASE mytest C: CREATE mytest D: DATABASE mytesst

    • 2

      25.Which of the following is not a good way to welcome a new person? A: a). talk to the new person B: b). give the new person a tour C: c). invite the new person to lunch D: d). ignore the new person's question

    • 3

      下列JavaScript定义对象的语句中,()不正确。 A: var person = {}; B: var person = new Object(); C: person =name; D: function person(name,sex){} var personObj = new person();

    • 4

      在Java中,有如下两个类Student和Person。如果Student是Person的子类,则下列声明对象x的语句中错误的是()。 A: Person x = new Student() B: Person x = new Person() C: Student x = new Person() D: Student x = new Student()