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题:
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?()
第2题:
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?()
第3题:
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]? ()
第4题:
Given that a static method doIt() in a class Work represents work to be done, what block of code will succeed in starting a new thread that will do the work? CODE BLOCK a: Runnable r = new Runnable() { public void run() { Work.doIt(); } }; Thread t = new Thread(r); t.start(); CODE BLOCK b: Thread t = new Thread() { public void start() { Work.doIt(); } }; t.start(); CODE BLOCK c: Runnable r = new Runnable() { public void run() { Work.doIt(); } }; r.start(); CODE BLOCK d: Thread t = new Thread(new Work()); t.start(); CODE BLOCK e: Runnable t = new Runnable() { public void run() { Work.doIt(); } }; t.run();
第5题:
You want to access employee details contained in flat files as part of the EMPLOYEE table. You planto add a new column to the EMPLOYEE table to achieve this. Which data type would you use for the new column()
第6题:
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You want to add an audio player that plays .wav or .mp3 files when the user clicks a button. You plan to store the name of the file to a variable named SoundFilePath. You need to ensure that when a user clicks the button, the file provided by SoundFilePath plays. What should you do?()
第7题:
CodeAccessPermission.RevertAssert();
CodeAccessPermission.RevertDeny();
permission.Deny();
permission.PermitOnly();
第8题:
Set set = new TreeSet();
Set set = new HashSet();
Set set = new SortedSet();
List set = new SortedList();
Set set = new LinkedHashSet();
第9题:
(i = = l)
(i = = d)
(d = = l)
(i.equals(d))
(i.equals(i))
(i.equals(42))
第10题:
Class MyDictionary Implements Dictionary (Of String,String)
Class MyDictionary Inherits HashTable
Class MyDictionary Implements IDictionary
Class MyDictionary End Class Dim t as New Dictionary (Of String, String) Dim dict As MyDIctionary= CType (t,MyDictionary)
第11题:
The code will not compile.
A Window will appear containing only a Button.
An IllegalArgumentException is thrown at line 6.
A Window button will appear but will not contain the Label, TextField, or Button.
A Window will appear containing a Label at the top, a TextField below the Label, and a Button below the TextField.
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.
第12题:
(i ==1)
(i == d)
(d == 1)
(i.equals (d))
(d.equals (i))
(i.equals (42))
第13题:
Given: Integer i = new Integer (42); Long l = new Long (42); Double d = new Double (42.0); Which two expression evaluate to true?()
第14题:
Integer i = new Integer (42); Long 1 = new Long (42); Double d = new Double (42.0); Which two expressions evaluate to True?()
第15题:
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? ()
第16题:
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 ?()
第17题:
You work as the application developer at Hi-Tech.com. You create a new custom dictionary named MyDictionary. Choose the code segment which will ensure that MyDictionary is type safe?()
第18题:
MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;} %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { . MY_ARRAY[${i}] = ’${serverArray[i]}’;. } %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;. <% } %>
MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[${i}] = ’${serverArray[i]}’;. <% } %>
第19题:
Write the following code segment in the button onclick event. System.Media. SoundPlayer player = new System.Media. SoundPlayer(SoundFilePath); player.play();
Write the following code segment in the button onclick event. MediaPlayer player = new MediaPlayer(); player.Open(new URI(SoundFilePath), UriKind.Relative)); player.play();
Use the following code segment from the PlaySound() Win32 API function and call the PlaySound function in the button onclick event. [sysimport(dll=winmm.dll)] public static extern long PlaySound(String SoundFilePath, long hModule, long dwFlags);
Reference the Microsoft.DirectX Dynamic Link Libraries. Use the following code segment in the button onclick event. Audio song = new Song(SoundFilePath); song.CurrentPosition = song.Duration; song.Play();
第20题:
long customerOID = 47L;session.setAttribute(customerOID, new Long(customerOID));
long customerOID = 47L;session.setLongAttribute(customerOID, new Long(customerOID));
long customerOID = 47L;session.setAttribute(customerOID, customerOID);
long customerOID = 47L;session.setNumericAttribute(customerOID, new Long(customerOID));
第21题:
Stack<string> undoBuffer=new Stack<string>();
Stack undoBuffer=new Stack();
Queue
Queue undoBuffer=new Queue();
第22题:
Use the following code: Client foundClient;foundClient = (Client) cData.Find (10111);
Use the following code: Client foundClient;if (cData.Contains (10111)) foundClient = cData [10111];
Use the following code: Client foundClient;if (cData.Contains (10111))foundClient =(Client) cData [10111];
Use the following code: Client foundClient;foreach (string key in cData.Keys {if (key == 10111)foundClient = (Client) cData.Values [10111]; }
第23题:
Code block a.
Code block B.
Code block c.
Code block d.
Code block e.