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.
第1题:
Which of the following statements about variables and scope 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题:
The default constructor initializes method variables.
The default constructor has the same access as its class.
The default constructor invoked the no-arg constructor of the superclass.
If a class lacks a no-arg constructor, the compiler always creates a default constructor.
The compiler creates a default constructor only when there are no other constructors for the class.
第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 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.
第10题:
Instance variables are member variables of a class.
Instance variables are declared with the static keyword.
Local variables defined inside a method are created when the method is executed.
Local variables must be initialized before they are used.
第11题:
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.
第12题:
b.equals(b) returns true.
b.equals(c) returns the same result as b == c.
b.eqials(c) can return false even if c.equals(b) returns true.
b.equals(c) throws an exception if b and c are different wrapper types.
b.equals(c) returns false if the type of wrapper objects being compared are different.
第13题:
Given that b and c refer to instances of wrapper classes, which two statements are true?()
第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题:
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.
第18题:
The participants were postgraduates learning French as a second language.
All the participants were taught using the conventional method, with the focus on listening strategies.
The two groups were taught by different teachers.
The participants were at the same initial skill level.
第19题:
A routing protocol is assigned to an interface and determines the method of packet delivery.
A routed protocol is assigned to an interface and determines the method of packet delivery.
A routing protocol determines the path of a packet through a network.
A routed protocol determines the path of a packet through a network.
A routing protocol operates at the transport layer of the OSI model.
A routed protocol updates the routing table of a router.
第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题:
A routed protocol is assigned to an interface and determines the method of packet deliver.
A routing protocol determines the path of a packet through a network.
A routed protocol determines the path of a packet through a network.
A routing protocol operates at the transport layer of the OSI model.
A routed protocol updates the routing table of a router.
第22题:
The total current flow equals the sum of the individual currents
The total current flow equals the reciprocal of the sum of the individual currents
The total resistance equals the sum of the individual resistance
The total voltage equals the sum of the individual voltages across each resistance
第23题:
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.
第24题:
Local variables defined inside a method are destroyed when the method is exited.
Local variables are also called automatic variables.
Variables defined outside a method are created when the object is constructed.
A method parameter variable continues to exist for as long as the object is needed in which the method is defined.