1Z0-869 Web TestEngine demo

Exit VCEDump 1Z0-869 Java Mobile Edition 1 Mobile Application Developer Certified Professional
Question 6 of 51
0% complete
Q6 Single choice

A JTWI device has a working socket implementation. A MIDlet requests permission to use socket connections on this device using the attribute MIDlet-Permissions-Opt, but is denied permission.

Given:

20. public void connect() {

21. try {

22. String addr = "socket://host.com:79";

23. SocketConnection sc;

24. sc = (SocketConnection) Connector.open(addr);

25. sc.setSocketOption(SocketConnection.LINGER, 5);

26. InputStream is = sc.openInputStream();

27. OutputStream os = sc.openOutputStream();

28. os.write("\\r\\n".getBytes());

29. int ch = is.read();

30. // ...

35. } catch (IOException ioe) {

36. // ...

40. }

41. }

Which is true assuming that the argument to Connector.open() points to a valid destination, and the device has resources to create new socket connections?

Sign in to mark questions

Sign in to save marked questions and return to this demo.

Sign in