类Teacher:classTeacher{Stringname;floatsalary;Teacher(Stringname){this.name=name;}Teacher(Stringname,floatsalary){this.name=name;this.salary=salary;}}执行语句Teachert=newTeacher(Tom”,2000.0f);后,字段salary的值是哪一项?()
A.2000.0f
B.0.0f
C.null;
D.2000
第1题:
A.ThetimetofindthevaluefromHashMapwithaPersonkeydependsonthesizeofthemap.
B.DeletingaPersonkeyfromaHashMapwilldeleteallmapentriesforallkeysoftypePerson.
C.InsertingasecondPersonobjectintoaHashSetwillcausethefirstPersonobjecttoberemovedasaduplicate.
D.ThetimetodeterminewhetheraPersonobjectiscontainedinaHashSetisconstantanddoesNOTdependonthesizeofthemap.
第2题:
以下字符串定义错误的是___________。
A.char s[7]="Teacher";
B.char s[]="Teacher";
C.char s[10]={"Teacher"};
D.char s[10]="Teacher";
第3题:
下面对象的声明正确的是()。
A.Teacher t1;
B.Teacher t2=class Teacher();
C.Teacher t3=new Teacher();
D.Teacher t4=Teacher();
第4题:
A.public Person(){}
B.public Person(String name,int age) { this.name = name; this.age = age; }
C.public Person(int age,String name) { this.age = age; this.name = name; }
D.public Person(String name) { this.name = name; }
第5题:
3、下面对象的声明正确的是()。
A.Teacher t1;
B.Teacher t2=class Teacher();
C.Teacher t3=new Teacher();
D.Teacher t4=Teacher();