The hashCode method for a given class can be used to test for object equality and object inequality for that class.
The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.
The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.
第1题:
Which statements concerning the methods notify() and notifyAll() are true?
第2题:
Which of the following statements are true?()
第3题:
public class Person { private name; public Person(String name) { this.name = name; } public boolean equals(Object o) { if( !o instanceof Person ) return false; Person p = (Person) o; return p.name.equals(this.name); } } Which is true?()
第4题:
Which statement is true?()
第5题:
The equals() method determines if reference values refer to the same object.
The == operator determines if the contents and type of two separate objects match.
The equals() method returns true only when the contents of two objects match.
The class File overrides equals() to return true if the contents and type of two separate objects match.
第6题:
If the hashCode values are different, the objects might be equal.
If the hashCode values are the same, the object must be equal.
If the hashCode values are the same, the objects might be equal.
If the hashCode values are different, the objects must be unequal.
第7题:
A finalizer may NOT be invoked explicitly.
The finalize method declared in class Object takes no action.
super.finalize()is called implicitly by any over riding finalize method.
The finalize method for a given objec twill be called no more than once by the garbage collector.
The order in which finalize will be called on two objects is based on the order in which the two objects became finalizable.
第8题:
Compilation fails because the hashCode method is not overridden.
A HashSet could contain multiple Person objects with the same name.
All Person objects will have the same hash code because the hashCode method is not overridden.
If a HashSet contains more than one Person object with name=”Fred”, then removing another person, also with name=”Fred”, will remove them all.
第9题:
The hashCode method for a given class can be used to test for object equality and object inequality for that class.
The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.
The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.
第10题:
The hashCode method for a given class can be used to test for object equality and object inequality for that class.
The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.
The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.
第11题:
The charAt() method of the String class.
The toUpperCase() method of the String class.
The replace() method of the String class.
The reverse() method of the StringBuffer class.
The length() method of the StringBuffer class.
第12题:
It can be invoked only from the doGet or doPost methods.
It can be used independently of the getRemoteUser method.
Can return true even when its argument is NOT defined as a valid role name in the deployment descriptor.
Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.
第13题:
Which two statements are true regarding the return values of property written hashCode and equals methods from two instances of the same class?()
第14题:
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
第15题:
Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()
第16题:
Which two statements are true about the hashCode method?()
第17题:
The method waitforId() in class MediaTracker is called.
The run() method that the thread is executing ends.
The call to the start() method of the Thread object returns.
The suspend() method is called on the Thread object.
The wait() method is called on the Thread object.
第18题:
Your filter class must implement an init method and a destroy method.
Your filter class must also implement javax.servlet.FilterChain.
When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.
The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.
Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.
第19题:
Instances of class Thread have a method called notify().
A call to the method notify() will wake the thread that currently owns the monitor of the object.
The method notify() is synchronized.
The method notifyAll() is defined in class Thread.
When there is more than one thread waiting to obtain the monitor of an object, there is no way to be sure which thread will be notified by the notify() method.
第20题:
A class’s finalize() method CANNOT be invoked explicitly.
super.finalize() is called implicitly by any overriding finalize() method.
The finalize() method for a given object is called no more than once by the garbage collector.
The order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.
第21题:
The class implements java.lang.Comparable.
The class implements java.util.Comparator.
The interface used to implement sorting allows this class to define only one sort sequence.
The interface used to implement sorting allows this class to define many different sort sequences.
第22题:
Compilation fails because the hashCode method is not overridden.
A HashSet could contain multiple Person objects with the same name.
All Person objects will have the same hash code because the hashCode method is not overridden.
If a HashSet contains more than one Person object with name="Fred", then removing another Person,also with name="Fred", will remove them all.
第23题:
Compilation fails because the hashCode method is not overridden.
A HashSet could contain multiple Person objects with the same name.
All Person objects will have the same hash code because the hashCode method is not overridden.
If a HashSet contains more than one Person object with name="Fred", then removing another Person, also with name="Fred", will remove them all.
第24题:
return super.hashCode();
return name.hashCode() + age * 7;
return name.hashCode() + comment.hashCode() /2;
return name.hashCode() + comment.hashCode() / 2 - age * 3;