310-110 Sun Certified Mobile Application Developer for J2ME Set 5

Given the MIDlet code:

11. public void startApp() {

12. Form f = new Form("hello");

13. Display.getDisplay(this).setCurrent(f);

14. System.gc();

15. System.exit(0);

16. f.append("foo");

17. }

What is the result?



Options are :

  • Compilation fails.
  • The application runs, but line 15 is ignored.
  • The application runs, but throws an exception at runtime.
  • The application runs, and foo prints to the current display.

Answer : The application runs, but throws an exception at runtime.

310-110 Sun Certified Mobile Application Developer for J2ME Set 6

Which two are true? (Choose two.)

A. MIDP 2.0 is a set of APIs that runs on top of the CLDC.

B. The J2SE specification extends the MIDP specification.

C. WMA provides a set of APIs for multimedia content handling.

D. The goal of the CLDC is to guarantee portability and interoperability between various types of

resource-constrained devices.



Options are :

  • A,D
  • A,B
  • C,D
  • A,C

Answer : A,D

Which method in javax.microedition.midlet.MIDlet is used to retrieve the attributes necessary to

access a record store in a different MIDlet suite?



Options are :

  • checkPermission()
  • platformRequest()
  • getProperty()
  • getAttribute()
  • getAppProperty()
  • getSuiteProperty()

Answer : getAppProperty()

Given:

10. //...

20. int note = ToneControl.C4;

21. for (int i=0; i<200; i++) {

22. Manager.playTone(note += 2, 100, 10);

23. }

24. System.out.println("done");

25. //...

Which is true?



Options are :

  • Compilation fails.
  • The program hangs in the for loop.
  • A tone sequence of rising pitch plays and done is printed.
  • An IllegalArgumentException is thrown at runtime.

Answer : An IllegalArgumentException is thrown at runtime.

310-110 Sun Certified Mobile Application Developer for J2ME Set 7

Which is true about the installation status report definition?



Options are :

  • A MIDlet suite CANNOT be removed until the installation notification has been successfully sent and the acknowledgement has been received.
  • The only protocols supported for the status report notification are HTTP and UDP.
  • If the installation status report CANNOT be sent, the device must refuse the installation of the MIDlet suite.
  • In response to an installation status report, the server must reply with a 200 OK. HTTP acknowledgement response.

Answer : In response to an installation status report, the server must reply with a 200 OK. HTTP acknowledgement response.

Which three classes are subclasses of Item? (Choose three.)

A. List

B. Form

C. Gauge

D. Alert

E. TextBox

F. TextField

G. ChoiceGroup


Options are :

  • C,D,G
  • C,F,A
  • C,F,G
  • B,F,G

Answer : C,F,G

Given:

11. HttpsConnection c = (HttpsConnection)

Connector.open("https://www.mywebserver.com");

12. int portNumber = c.getPort();

What is the value of the portNumber variable after executing the code?



Options are :

  • 0
  • 443
  • 80
  • 25

Answer : 443

310-110 Sun Certified Mobile Application Developer for J2ME Set 8

Given:

10. Player p = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);

11. VolumeControl vc = p.getVolumeControl();

12. vc.setLevel(42);

13. vc.setMute(true);

14. System.out.println(vc.getLevel());

Which is printed to the console?



Options are :

  • null
  • 0
  • 42
  • -1

Answer : 42

Given the MIDlet code:

3. public void go() {

4. try {

5. doStuff();

6. } catch(java.lang.IllegalAccessError e) {

7. aForm.append("An Error");

8. }

9. }

Assuming the aForm variable on line 7 is a correctly initialized Form and set to the current display,

what is the result?



Options are :

  • The MIDlet fails at runtime due to a problem on line 6.
  • The MIDlet fails at runtime due to a problem on line 7.
  • An Error is printed to the display if an IllegalAccessError occurs.
  • Compilation fails due to a problem on line 6.
  • Compilation fails due to a problem on line 7.

Answer : Compilation fails due to a problem on line 6.

Given the MIDlet code:

11. DatagramConnection dgc =

(DatagramConnection)Connector.open("datagram://:444");

12. Datagram datagram = dgc.newDatagram(20);

13. dgc.receive(datagram);

14. byte[] data = datagram.getData();

15. String s = new String(data);

16. list.append(s, null);

17. System.out.println("Datagram received: " + s);

Which two are true regarding the portability of the code between devices? (Choose two.)

A. Datagrams may not be supported on all platforms.

B. Installation will fail on devices that do not support datagrams.

C. Port 444 may be restricted or ignored by some MIDP implementations.

D. The code is portable because all the classes and interfaces used are defined in the CLDC.


Options are :

  • A,C
  • D,C
  • A,D
  • A,B

Answer : A,C

310-110 Sun Certified Mobile Application Developer for J2ME Set 9

A MIDlet makes its only attempt to register a push connection on a JTWI device using:

PushRegistry.registerConnection(

"datagram://:79", midlet, "10.0.0.???");

Which is true?



Options are :

  • The MIDlet accepts datagram push connections on port 79 only from IP addresses in the range 10.0.0.100 to 10.0.0.255.
  • The call to registerConnection() causes an exception, because the string 10.0.0.??? is an illegal argument.
  • The MIDlet accepts datagram push connections on port 79 only from IP addresses in the range 10.0.0.0 to 10.0.0.255.
  • The MIDlet accepts datagram push connections on port 79 only from IP addresses in the range 10.0.0.100 to 10.0.0.255 and on any other port from IP addresses other than those in the range 10.0.0.100 to 10.0.0.255.

Answer : The MIDlet accepts datagram push connections on port 79 only from IP addresses in the range 10.0.0.100 to 10.0.0.255.

Which is true about the garbage collector?



Options are :

  • It needs to be run by the developer.
  • It manages all memory deallocation.
  • It always uses the mark and sweep algorithm.
  • It effectively prevents memory leaks.

Answer : It manages all memory deallocation.

What is the minimum configuration that JTWI 1.0 requires?



Options are :

  • CLDC 1.0
  • no specific configuration
  • CLDC 1.1
  • CDC

Answer : CLDC 1.0

Sun 310-110 Certified Mobile Application Developer for Exam Set 1

Given the MIDlet code:

7.//..

10.public void startApp(){

11.Float f = new Float(3.14);

12.System.out.println("Pi: " + f);

13.

14.}

15.//..

What is the result when working with a CLDC 1.1 implementation?



Options are :

  • Compilation fails.
  • Pi: 3.14 is sent to the system console.
  • Pi: 3.14 is sent to the device display.
  • An exception is thrown at runtime.

Answer : Pi: 3.14 is sent to the system console.

Given:

8. package javax.microedition.midlet;

9. import javax.microedition.midlet.*;

10. import javax.microedition.io.*;

11. import java.io.*;

12.

13. public class Outlet extends MIDlet {

14. public void startApp(){ }

15. public void pauseApp(){ }

16. public void destroyApp(boolean unconditional){ }

17. }

Which is true?



Options are :

  • Compilation fails because of an error in line 8.
  • The application will NOT compile.
  • The application will compile and will NOT execute.
  • The application will compile and will execute.

Answer : The application will compile and will NOT execute.

Given:

15. String addr = "sms://+14155557296";

16. MessageConnection conn

17. = (MessageConnection) Connector.open(addr);

18. // insert code here

19. message.setPayloadData(imageBytes);

Assume imageBytes is a valid byte array.

Which statement, inserted at line 18, causes the rest of the code fragment to compile correctly?



Options are :

  • Message message = new BinaryMessage();
  • BinaryMessage message = new BinaryMessage();
  • Message message = conn.newMessage(MessageConnection.BINARY_MESSAGE);
  • BinaryMessage message = (BinaryMessage) conn.newMessage(MessageConnection.BINARY_MESSAGE);

Answer : BinaryMessage message = (BinaryMessage) conn.newMessage(MessageConnection.BINARY_MESSAGE);

Sun 310-110 Certified Mobile Application Developer for Exam Set 2

Which arguments should be passed to Connector.open() and TextMessage.setAddress(),

respectively, to initiate an SMS text message using a server connection?



Options are :

  • sms://:1234, with no need to call setAddress()
  • sms://:1234 and sms://+18005551234
  • sms://+18005551234, with no need to call setAddress()
  • sms://+18005551234 and sms://:1234

Answer : sms://:1234 and sms://+18005551234

Given the MIDlet code:

15. boolean main_called;

16. public static void main(String args[]) {

17. main_called = true;

18. }

19. public void startApp() {

20. int a;

21. if (true == main_called) {

22. a = 1;

23. } else {

24. a = 5;

25. }

26. }

What is the result?



Options are :

  • The source compiles. The application management system will not load this MIDlet.
  • The source compiles. The MIDlet is started and a = 5.
  • A compilation error occurs when compiling this source.
  • An error occurs at compile time.
  • The source compiles. The MIDlet is started and a = 1.

Answer : The source compiles. The MIDlet is started and a = 5.

A Player plays a sound after start() is called. Which is the most efficient way to pause the playback

so that it may be started as soon as possible when required?



Options are :

  • call close() on the player
  • call stop() on the player
  • call setRate(0) on the player
  • call System.gc() to collect those resources marked for garbage collection

Answer : call stop() on the player

Sun 310-110 Certified Mobile Application Developer for Exam Set 3

Which two can a developer use to create a Timer that will go off in 5 seconds, repeating every 3

seconds? (Choose two.)

A. timer.schedule(timerTask, 5, 3);

B. timer.schedule(timerTask, 5000, 3000);

C. timer.scheduleAtFixedRate(timerTask, 5, 3);

D. timer.scheduleAtFixedRate(timerTask, 5000, 3000);

E. timer.schedule(timerTask, new Date().getTime() + 5000, 3000);


Options are :

  • B,E
  • B,A
  • C,D
  • B,D

Answer : B,D

In the JTWI 1.0 specification, what is the recommended screen size as returned by

Canvas.getHeight() and Canvas.getWidth(), when in full screen mode?



Options are :

  • 176x208 pixels
  • 320x240 pixels
  • 125x125 pixels
  • 96x54 pixels

Answer : 125x125 pixels

Given the JAD file fragment:

MIDlet-1: Calendar, calendar.png, com.example.CalendarMIDlet

MIDlet-2: Chat, chat.png, com.example.ChatMIDlet

What CalendarMIDlet code launches ChatMIDlet at the time specified by variable chatTime?



Options are :

  • PushRegistry.registerAlarm (Class.forName("com.example.ChatMIDlet"), chatTime);
  • PushRegistry.registerAlarm("Chat", chatTime);
  • PushRegistry.registerAlarm ("com.example.ChatMIDlet", chatTime);
  • PushRegistry.registerAlarm("MIDlet-1", chatTime);

Answer : PushRegistry.registerAlarm ("com.example.ChatMIDlet", chatTime);

Sun 310-110 Certified Mobile Application Developer for Exam Set 4

Which is true about a Ticker object?



Options are :

  • The Ticker can be started and stopped through methods in the API.
  • A Ticker may be shared by several Displayable objects.
  • Direction and speed of scrolling can be controlled through methods in the API.
  • Ticker is a subclass of Screen.

Answer : A Ticker may be shared by several Displayable objects.

Given the MIDlet code:

20. String arg = "telepathy:op=mind.read, target=James.Gosling";

21. Connection conn = Connector.open(arg);

Assume telepathy is an unsupported protocol.

Which is true?



Options are :

  • An exception is thrown at runtime.
  • Compilation fails.
  • The system quietly ignores the request.
  • The user is presented with an alert.

Answer : An exception is thrown at runtime.

Which two are true about MIDlet suite provisioning? (Choose two.)

A. A JTWI-compliant device must support HTTP 1.1.

B. A JTWI-compliant device must support HTTP 1.0.

C. A JTWI-compliant device must support HTTP authentication.

D. A JTWI-compliant device must support HTTP 1.1 and cookies.


Options are :

  • A,B
  • A,D
  • A,C
  • D,C

Answer : A,C

Sun 310-110 Certified Mobile Application Developer for Exam Set 5

Which four are absent from the CLDC virtual machine? (Choose four.)

A. multi-threading

B. class file verification

C. custom class loaders

D. asynchronous exceptions

E. inner and anonymous classes

F. object.finalize() method

G. thread groups and daemon threads


Options are :

  • E,D,F,G
  • C,B,F,G
  • C,D,F,A
  • C,D,F,G

Answer : C,D,F,G

What is the result if a call to serviceRepaints() triggers a separate thread to invoke paint()?



Options are :

  • The system may deadlock if the caller to serviceRepaints() holds a lock that is also needed by paint().
  • An exception is thrown at runtime.
  • A deadlock always occurs.
  • MIDP is thread-safe. There will never be a deadlock.

Answer : The system may deadlock if the caller to serviceRepaints() holds a lock that is also needed by paint().

A MIDlet suite is signed using X.509 PKI. Which encoding format must be used for the certificate

entries in the JAD file?



Options are :

  • base64
  • yEnc
  • none
  • binary

Answer : base64

Which two methods are available only within classes of the MIDP low-level UI API? (Choose two.)

A. getLayout()

B. hasRepeatEvents()

C. setPreferredSize()

D. setFullScreenMode()

E. notifyStateChanged()


Options are :

  • E,D
  • B,E
  • A,D
  • B,D

Answer : B,D

Given:

10. public class ExampleMIDlet extends MIDlet {

11. //...

20. public boolean hasCompleted() {

21. //...

30. }

31. public boolean isLowOnMemory() {

32. //...

40. }

41. public void destroyApp(boolean arg) {

42. if (X) throw new MIDletStateChangeException();

43. }

44. //...

50. }

Which substitution for X conforms to the MIDP specification?



Options are :

  • !hasCompleted()
  • isLowOnMemory()
  • !arg
  • true
  • arg && isLowOnMemory()
  • !arg || !hasCompleted()

Answer : !arg

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions