语句“Person myTest1 = new Person(“张三”,21,60012) ” 与语句“ Person myTest1; myTest1 = new Person(“张三” , 21,60012)”等价。( )
举一反三
- Student类是Person类的子类,分析下面语句,转型是否正确: Student s =(Student)new Person("张三", 23);
- 【单选题】父类Person有子类Chinese和American,且两个子类都重写了父类中的walk()方法;下列哪项实现了多态编程 A. Chinese c=new Chinese("张三"); American a=new American("John"); B. Chinese c=new Chinese( "张三"); American a=new American("John"); c.walk(); a.walk(); C. Person person1=new Chinese("张三" ); Person person2=new American("John"); D. Person person1=new Chinese("张三" ); Person person2=new American("John"); person1.walk(); person2.walk();
- 【多选题】定义了如下Person类,下面()程序段能够正确初始化Person数组。 class Person{ private String name; public Person(String name){ this.name=name; } } A. Person [ ] list=new Person[ ]{new Person("孙悟空"),new Person("猪八戒")}; B. Person list[ ]=new Person[ ]{new Person("孙悟空"),new Person("猪八戒")}; C. Person[ ] list={new Person("孙悟空"),new Person("猪八戒")}; D. Person list=new Person[ ]{new Person("孙悟空"),new Person("猪八戒")};
- 使用SQL语句删除表mytest,下列SQL语句正确的是( )。 A: DROP TABLE mytest IF EXISTS B: DROP TABLE IF EXISTS mytest C: ALTER TABLE IF EXISTS mytest ALTER TABLE mytest IF EXISTS
- 【单选题】10、使用SQL语句创建数据库,数据库名为mytest,下列SQL语句写法是正确的是()。 A. create mytest B. create table mytest C. database mytest D. create database mytest