hashCode() and equals() method for each object type is different so a different key is used
each object value string is different so a different value is inserted on each put
equals() and compare() method is different for each put
POF need to be implemented for this to work properly
第1题:
YouwanttouseteCoherenceJavaAPIstodirectlycachedPOJOs.Considerthissnippetofcode:NamedCachecache-CacheFactory.getCache("mycache");cache.put(newInteger(I)f"hello");cache.put(T,"hi");cache.put(newLong(II),"hey");Thiscodeinsertsthreeobjectsintothecache.Why?()
A.hashCode()andequals()methodforeachobjecttypeisdifferentsoadifferentkeyisused
B.eachobjectvaluestringisdifferentsoadifferentvalueisinsertedoneachput
C.equals()andcompare()methodisdifferentforeachput
D.POFneedtobeimplementedforthistoworkproperly
第2题:
You need to create a JSP that generates some JavaScript code to populate an array of strings used on theclient-side. Which JSP code snippet will create this array?()
第3题:
You need to write a code segment that transfers the contents of a byte array named dataToSendby using a NetworkStream object named netStream.You need to use a cache of size 8,192 bytes.Which code segment should you use?()
A.
B.
C.
D.
第4题:
1. import java.util.*; 2. public class Example { 3. public static void main(String[] args) { 4. // insert code here 5. set.add(new integer(2)); 6. set.add(new integer(l)); 7. System.out.println(set); 8. } 9. } Which code, inserted at line 4, guarantees that this program will output [1,2]? ()
第5题:
You work as an application developer at Certkiller .com. Certkiller .com wants you to develop an application that stores and retrieves client information by means of a unique account number.You create a custom collection class, which implements the IDictionary interface,named ClientDictionary. The following code have been included into the new application. //Create Client objects Client c1 = new Client ("AReid", "Andy Reid", Status.Current); Client c2 = new Client ("DAustin", "Dean Austin", Status.New); //Create ClientDictionary object IDictionary cData = new ClientDictionary (); cData.Add ("10001", c1); cData.Add ("10002", c2); You use the same method to add other Client objects to the collection. You need to ensure that you are able to retrieve client information associated with the account number 10111.What should you do?()
第6题:
You need to store a Java long primitive attribute, called customerOID, into the session scope. Which two code snippets allow you to insert this value into the session?()
第7题:
Given: Integer i = new Integer (42); Long l = new Long (42); Double d = new Double (42.0); Which two expression evaluate to true?()
第8题:
You need to write a code segment that transfers the first 80 bytes from a stream variable named stream1 into a new byte array named byteArray.You also need to ensure that the code segment assigns the number of bytes that are transferred to an integer variable named bytesTransferred.Which code segment should you use?()
A.bytesTransferred=stream1.Read(byteArray,0,80);
B.
C.
D.
第9题:
Integer i = new Integer (42); Long 1 = new Long (42); Double d = new Double (42.0); Which two expressions evaluate to True?()
第10题:
import java.awt.*; public class Test extends Frame { public Test() { add(new Label(“Hello”) ); add(new TextField(“Hello”) ); add(new Button(“Hello”) ); pack(); show(); } public static void main(String args) { new Test (); } } What is the result? ()