Mock Exam Batch 1!!

OK folks, don't flame me if I made some errors here These are first drafts... and this is the first of two sets I will make. I will do more GUI stuff a little later in the week, but this is a start, and covers mainly the first half of the objectives... I hope you will discuss them and I will post the answers later, and/or at least *confirm* that you all have arrived at the correct answer. If you find an error in the question itself, let me know immediately and I'll change it. Have fun Oh yeah, I have done a few things a little differently than the real exam: 1) The real exam tells you how many answers to select. I'm not doing that, which means THESE questions are a little more difficult than in the real exam. 2) To keep it smaller, I've made some of my questions have *more* possible answers than in the real exam. So, in the exam you might have several smaller questions on one topic, but I've put them into one big question with a LOT of possible answers. 3) The real exam uses drag and drops, which I can't represent here... but in a couple of questions I ask you to put a letter or mark next to a word or class name to get you to do the same kind of thing you might have to do in a drag and drop. 4) I did not include much code here, but there IS a lot of code in the real exam. I can't get my VirtualPC working tonight, so I couldn't compile anything and I don't want to mislead you. I'll get things working again before I post the second batch, so the next set will have code. But the questions here are still VERY representative of the types of questions on the real exam. ================================== 1) Which are true about JTWI 1.0? A) CLDC 1.1 is the minimum CLDC requirement. B) CLDC 1.0 is the minimum CLDC requirement. C) A JTWI-compliant device must support a MIDlet suite JAR size up to 64 KB. D) A JTWI-compliant device must support a MIDlet suite JAR size up to 128 KB. E) MIDP 2.0 is required. F) WMA 1.1 is an optional specification. ==============================

2) Which is true about MMAPI and JTWI? A) All of MMAPI must be implemented in a JTWI-compliant device. B) A JTWI device must implement all of the MMAPI, PLUS additional media APIs. C) A JTWI device must implement a subset, but not all, of the MMAPI. D) A JTWI device must implement ONLY a subset, and never all, of the MMAPI. E) A JTWI device must support media types explicitly defined in JTWI, regardless of whether they are specified in MMAPI. ==============================

3) A FAKE drag and drop Given the list of classes below, put a "B" next to those which exist in both J2SE and CLDC 1.1, put a "C" for those which exist ONLY in CLDC 1.1 (but not in J2SE) and put a "J" next to those which exist ONLY in J2SE (but not in CLDC 1.1).

4) Given the MIDlet code: public void notifyDestroyed() { System.out.println("foo"); System.exit(0); System.out.println("bar"); } What is the result? (assume that the device has a console for System.out) A) Compilation fails. B) "foo" (but not "bar") is sent to the console. C) Code throws a runtime exception. D) Both "foo" and "bar" are sent to the console. E) Compilation succeeds, and the code does not throw an exception, but nothing is output from that method. ==============================

5) Which are true about MIDlets? A) Classes in one suite have restricted access to classes in a other suites. B) Classes in one suite have full access to classes in another suite, as long as both suites are trusted. C) Classes in one suite can never access classes in other suites. ==============================

6) Which are true? A) A MIDlet can never be installed in an untrusted domain. B) A MIDlet suite can be installed in an untrusted domain ONLY if the suite is signed with an x.509 PKI certificate. C) A MIDlet can be installed in an untrusted domain if the suite is authenticated with an invalid cx.509 PKI certificate. D) a MIDlet can be installed in an untrusted domain if it is not signed with a x.509 PKI certificate. E) An untrusted suite can request permissions in the JAR manifest. F) An untrusted suite can never access protected functions. G) All MIDP 1.0 suites are considered trusted. H) All CLDC suites are considered trusted.

============================== 7) Which are true? A) A suite using x.509 PKI authentication must have a midlet-permission JAD attribute. B) Suites using x.509 PKI authentication must have a security certificate inside the META-INF directory. C) A suite using x.509 PKI authentication must use base64 encoding for the certificate. ============================== 8) Which connection String goes with the SocketConnection interface? A) socket://:4242 B) http://foo.sun.com C) socket:162.101.4.100:4242 D) datagram://:4242 ============================== 9) Which are true? A) A MIDP 2.0 device is guaranteed to be able to create an HTTP connection to a server that supports HTTP 1.1. B) A MIDP 2.0 device can NOT create HTTP connections. C) A MIDP 2.0 device is not required to support HTTP 1.1, but it may. ============================== 10) What is the function of the Application Descriptor? [on real exam, you would not answer this as an essay, but I didn't have time to come up with good answers for it ] ============================== 11. Which are true? A) A MIDlet cannot access its manifest. B) A MIDlet can access its manifest as a system property. C) A MIDlet can access its manifest using a method from Class. D) Only a trusted MIDlet can access its manifest. E) MIDlets are not allowed to have manifests. ============================== 12. [not a question... be preared to read and write a JAD file] ============================== 13. Which are true? A) A MIDlet suite can have more than one MIDlet. B) A single JAD file can specify more than one MIDlet. C) A JAD file specifies the Jar-Size D) A JAD file does not specify the URL of the jar. ============================== 14) Which is true about push notification? A) A MIDlet's push() method will be called initially. B) A MIDlet's startApp() will be called initially. C) A MIDlet's pushNotification() will be called initially D) A MIDlet's pushListener() will be called initially. E) A MIDlet's init() method will be called initially. F) A MIDlet's notifyConnection() will be called initially. ============================== 15) Given a push connection String:

============================== 16) Put an "H" next to the code or class from the high-level MIDP 2.0 API, and and an "L" next to those from the low-level API. Put a "E" for those things that could apply to either high-level or low-level, depending on how they're used. When we use "...", assume that whatever you don't see is correct. new Command(...); Form f = new Form(); graphicsObject.setColor(...); new Canvas(...); paint(Graphics g) { } Sprite LayerManager ==============================

OK, now it's your turn folks, so GET BUSY working on these ; ) cheers, Kathy "Just a J2ME girl living in a J2EE world"

Hi Kathy! I (and some other guys too) am afraid tha i can't put my hands in a voucher for this exam. I really like to do this test! What can I do? I sent my request on jan 28 but until now i got no response, not even the automatic response from prometric... What can I do? Please see this topic too: http://www.coderanch.com/t/157039/po/certification/Evelyn-Must-send-new-request Thank you very much! [ February 04, 2004: Message edited by: Eduardo Rodrigues ]

Ramjet, I think the correct answer to 3 is: J/J/B/J/J/B/C/J/B/B/JVirtualMachineError exists in J2SE as well. IllegalAccessError only exists in J2SE, IllegalAccessException exists in both.

the sopskrutt
Greenhorn

Joined: Feb 16, 2004
Posts: 4

posted Feb 16, 2004 14:30:00

0

Also, a note on question 6: The suite can request permissions in the JAR manifest, however according to the specification, the MIDlet-Permissions and MIDlet-Permissions-Opt tags are ignored for unsigned (untrusted) MIDlets. Only signed MIDlets are required to use these tags. This is probably due to backwards compability to MIDP-1.0 MIDlets HTTP API access.

the sopskrutt
Greenhorn

Joined: Feb 16, 2004
Posts: 4

posted Feb 16, 2004 14:45:00

0

Heh, a few more things: Question 2: I would say that JTWI superseed all other specifications, so I'm tempted to add E to the answer list here. However that would be a little theoretical, since it would assume a future version of JTWI. Question 11: I would say that there is no valid answer. A is wrong, since a MIDlet can access attributes in its manifest using MIDlet.getAppProperty B is also wrong since the application properties (manifest and JAD values) are not system properties C is wrong, Class doesn't have this feature, MIDlet does. D and E are totally wrong, no comments needed. Question 16:

paint(Graphics g) { }

is almost used in the CustomItem (has additional parameters int and int), so one could consider setting both high- and low level on that one.

Originally posted by the sopskrutt: [QB]Heh, a few more things: Question 11: I would say that there is no valid answer. A is wrong, since a MIDlet can access attributes in its manifest using MIDlet.getAppProperty B is also wrong since the application properties (manifest and JAD values) are not system properties C is wrong, Class doesn't have this feature, MIDlet does. D and E are totally wrong, no comments needed.

I think the answer should be C. Since we got java.lang.Class.getResourceAsStream() to access the manifest file, right? Anyway, could kathy provide us your answers? :roll: [ February 17, 2004: Message edited by: Ken Ho ]

3) A FAKE drag and drop Given the list of classes below, put a "B" next to those which exist in both J2SE and CLDC 1.1, put a "C" for those which exist ONLY in CLDC 1.1 (but not in J2SE) and put a "J" next to those which exist ONLY in J2SE (but not in CLDC 1.1).ArrayList ...

Any class used in CLDC 1.1 will be supported by J2SE. I think if you choice includes "C", you are wrong. right?

Any class used in CLDC 1.1 will be supported by J2SE. I think if you choice includes "C", you are wrong. right?

so many class not included in J2SE,like GCF [ February 22, 2004: Message edited by: Weishe Zhao ]

SCJP,SCWCD,SCMAD,OCP9I, SCEA

Forrest Xu
Ranch Hand

Joined: Nov 16, 2002
Posts: 92

posted Feb 22, 2004 17:25:00

0

<B>quote: -------------------------------------------------------------------------------- Originally posted by Forrest Xu: Any class used in CLDC 1.1 will be supported by J2SE. I think if you choice includes "C", you are wrong. right? -------------------------------------------------------------------------------- so many class not included in J2SE,like GCF<B> J2SE includes CLDC! See page 23 JSR 139. So Any class used in CLDC 1.1 will be supported by J2SE. I think if you choice includes "C", you are wrong. right? most of GCF is MIDP. MIDP is not included by J2SE. Am I right?