单项选择题
A.hashcode()不等,equals()一定也不等
B.hashcode()相等,equals()可能相等,也可能不等
C.equals()方法判断相等的两个对象,hashcode()一定相等
D.equals()方法判断不相等的两个对象,hashcode()一定不相等
单项选择题 有下面代码importjava.util.*;classStudent{intage;Stringname;publicStudent(){}publicStudent(Stringname,intage){this.name=name;this.age=age;}publicinthashCode(){returnname.hashCode()+age;}publicbooleanequals(Objecto){if(o==null)returnfalse;if(o==this)returntrue;if(o.getClass()!=this.getClass())returnfalse;Studentstu=(Student)o;if(stu.name.equals(name)&&stu.age==age)returntrue;elsereturnfalse;}}publicclassTestHashSet{publicstaticvoidmain(Stringargs[]){Setset=newHashSet();Studentstu1=newStudent();Studentstu2=newStudent(“Tom”,18);Studentstu3=newStudent(“Tom”,18);set.add(stu1);set.add(stu2);set.add(stu3);System.out.println(set.size());}}下列说法正确的是()
单项选择题 请甄别下列对二叉树的使用和理解正确的是()
单项选择题 java当中关于二叉树的理解错误的是()