최신 Java Technology 1Z0-869 무료샘플문제:
1. Given:
1 0. //...
2 0. try {
2 1. Hashtable table = new Hashtable();
2 2. for (;;) table.put(new Object(), new Object());
2 3. } catch (OutOfMemoryException e) {
2 4. Display.getDisplay().setCurrent(new Alert("Out of Memory!"));
2 5. }
2 6. //...
Which is true?
A) The program hangs at line 22.
B) An exception is thrown at runtime but there is no guarantee an alert will be shown to the user.
C) Compilation fails.
D) Out of Memory! is printed to the system console.
2. Given:
MIDlet-Push-1: datagram://:444, com.fooworks.PushExample, *
MIDlet-Push-2: datagram://:555, com.fooworks.PushExample, *
are statically registered push connections and given:
1 1. protected void startApp() {
1 2. String[] connections = PushRegistry.listConnections(true);
1 3. if(connections.length == 0) {
1 4. connections = PushRegistry.listConnections(false);
1 5. for (int i=0; i < connections.length; i++) {
1 6. new DatagramHandler(connections[i]).start();
1 7. }
1 8. } else {
1 9. for (int i=0; i < connections.length; i++) {
2 0. new DatagramHandler(connections[i]).start();
2 1. }
2 2. }
2 3. }
Which two identify what will go wrong if the code is invoked by the Application Management Software in response to an inbound connection notification? (Choose two.)
A) The first inbound datagram is ignored, all subsequent datagrams are handled by DatagramHandler.
B) An IOException is thrown if there are no active connections.
C) Duplicate DatagramHandler objects are created if the MIDlet is paused and then resumed.
D) The first inbound datagram is handled, but all other datagrams are missed.
E) Datagrams for the active connection are handled, but any datagrams sent to the other port are missed.
3. Which two are true about sockets and datagrams? (Choose two.)
A) Data sent over a TCP/IP socket is received in the same order that it was sent.
B) Both datagrams and sockets use streams as the basis for their communication.
C) A datagram is an independent, self-contained message sent over the network.
D) Datagrams are guaranteed to reach their intended destination.
E) Closing a SocketConnection automatically closes any associated input or output streams.
F) Datagrams are used to send packets of data over a SocketConnection.
4. obscure is a content type unsupported on a device that executes: 10. String locator
"http://foobar.sun.com/content.obscure"; 11. Player player
Manager.createPlayer(locator); Which is true?
A) The file is interpreted as an HTML file.
B) The file is interpreted as an ASCII file.
C) player is set to null.
D) An exception is thrown at runtime.
5. Given the MIDlet code:
11. DatagramConnection dgc
(DatagramConnection)Connector.open("datagram://:444");
1 2. Datagram datagram = dgc.newDatagram(20);
1 3. dgc.receive(datagram);
1 4. byte[] data = datagram.getData();
1 5. String s = new String(data);
1 6. list.append(s, null);
1 7. System.out.println("Datagram received: " + s);
Which two are true regarding the portability of the code between devices? (Choose two.)
A) Port 444 may be restricted or ignored by some MIDP implementations.
B) Installation will fail on devices that do not support datagrams.
C) The code is portable because all the classes and interfaces used are defined in the CLDC.
D) Datagrams may not be supported on all platforms.
질문과 대답:
질문 # 1 정답: B | 질문 # 2 정답: C,E | 질문 # 3 정답: A,C | 질문 # 4 정답: D | 질문 # 5 정답: A,D |