单选题You want to use te Coherence Java APIs to directly cached POJOs. Consider this snippet of code: NamedCache cache - CacheFactory.getCache("mycache");  cache.put(new Integer(I)f "hello"); cache.put(T,"hi");  cache.put(new Long(II),"hey");  This code inse

题目
单选题
You want to use te Coherence Java APIs to directly cached POJOs. Consider this snippet of code: NamedCache cache - CacheFactory.getCache("mycache");  cache.put(new Integer(I)f "hello"); cache.put(T,"hi");  cache.put(new Long(II),"hey");  This code inserts three objects into the cache.  Why ?()
A

 hashCode() and equals() method for each object type is different so a different key is used

B

 each object value string is different so a different value is inserted on each put

C

 equals() and compare() method is different for each put

D

 POF need to be implemented for this to work properly

参考答案和解析
正确答案: A
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第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


参考答案:A

第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?()

  • A、MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;} %>
  • B、MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { . MY_ARRAY[${i}] = ’${serverArray[i]}’;. } %>
  • C、MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;. <% } %>
  • D、MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[${i}] = ’${serverArray[i]}’;. <% } %>

正确答案:C

第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.


参考答案:C

第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]? ()

  • A、 Set set = new TreeSet();
  • B、 Set set = new HashSet();
  • C、 Set set = new SortedSet();
  • D、 List set = new SortedList();
  • E、 Set set = new LinkedHashSet();

正确答案:A

第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?()

  • A、 Use the following code: Client foundClient;foundClient = (Client) cData.Find ("10111"); 
  • B、 Use the following code: Client foundClient;if (cData.Contains ("10111")) foundClient = cData ["10111"]; 
  • C、 Use the following code: Client foundClient;if (cData.Contains ("10111"))foundClient =(Client) cData ["10111"]; 
  • D、 Use the following code: Client foundClient;foreach (string key in cData.Keys {if (key == "10111")foundClient = (Client) cData.Values ["10111"]; }

正确答案:C

第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?()

  • A、long customerOID = 47L;session.setAttribute("customerOID", new Long(customerOID));
  • B、long customerOID = 47L;session.setLongAttribute("customerOID", new Long(customerOID));
  • C、long customerOID = 47L;session.setAttribute("customerOID", customerOID);
  • D、long customerOID = 47L;session.setNumericAttribute("customerOID", new Long(customerOID));

正确答案:A,C

第7题:

Given:  Integer i = new Integer (42);  Long l = new Long (42);  Double d = new Double (42.0);   Which two expression evaluate to true?()

  • A、 (i = = l)
  • B、 (i = = d)
  • C、 (d = = l)
  • D、 (i.equals(d))
  • E、 (i.equals(i))
  • F、 (i.equals(42))

正确答案:D,E

第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.


参考答案:A

第9题:

Integer i = new Integer (42);  Long 1 = new Long (42);  Double d = new Double (42.0);   Which two expressions evaluate to True?()

  • A、 (i ==1)
  • B、 (i == d)
  • C、 (d == 1)
  • D、 (i.equals (d))
  • E、 (d.equals (i))
  • F、 (i.equals (42)

正确答案:D,E

第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? () 

  • A、 The code will not compile.
  • B、 A Window will appear containing only a Button.
  • C、 An IllegalArgumentException is thrown at line 6.
  • D、 A Window button will appear but will not contain the Label, TextField, or Button.
  • E、 A Window will appear containing a Label at the top, a TextField below the Label, and a Button  below the TextField.
  • F、 A Window will appear containing a Label on the left, a TextField to the right of the Label, and a button to the right of the TextField.

正确答案:B

更多相关问题