J2ME simulation test questions and answers

zhaozj2021-02-16  95

These are Sun's J2ME test questions, organized, everyone can do a few points (5 points / questions), withdrawal and detailed explanation

One .programmer quiz

Find Out How Much You Know About The J2ME Mobile Information Device Profile (MIDP) with this Comprehensive QUIZ

1. A MIDlet IS A Java Class That Extends The Abstract Class:

A). Javax.microedition.midlet

B) .javax.microedition.midlet

C) .javax.microedition.midlet.mIdlet

D) .javax.microedition.midlet.mIdlet

2. Which One of the Following Methods of The Midlet Abstract Class Must Be Impletion by a MIDlet:

A) .initApp, StartApp

B) .startApp, DestroyApp

C )startapp, pauseapp, destroyApp

D) .initApp, StartApp, PauseApp, DestroyApp

3.After compling your midlet, You Must Process It with a command to ensure That it is valid before us by the kilo virtual machine (kVM). What is the name of what command?

A) .MIDP

B) .javac-bootclasspath

C) .preverify

D) .jar

4. A Java Application Descriptor (JAD) file is a text file that is similar to a manifest, except that it is not packaged in a JAR file Some of the shared attributes that must have identical values ​​are:. MIDlet-Name, MIDlet- Version, and Midlet-vendor. If any shared attributes area diffreent, then:

A) .The Ones in the descriptor override those in the manifest

B) .The Ones in The Manifest Override Those in The Descriptor

5. When Downloading Application Descriptors (.jad Files) from A Web Server, The Web Server Must Return A Mime Type of:

A) .text / vnd.sun.j2me.midp

B) .Text / vnd.sun.j2me.jad

C) .text / vnd.sun.j2me.app-descriptor

D) .Text / vnd.sun.j2me.midApp

6. A Midlet Suite Is a set of Midlets That Are Packed TOGETHER INTO A SINGLE JAR FILE. MIDLETS WITHIN THE SAME Suite:

A) .ca Share the classes and resources contained in the jar file

B) .cannot Share the classes and resources contained in the jar file7. Midlets from Different Suites:

A) .caN interact directly.

B) .canNot Interact Directly

8. What is The Difference Between a configuration (Such as the cldc) And a profile?

A) .a configuration defines The Set of Class Libraries Available for a Particular Domain of Devices, and a profile provides I / O and NetWork APIs.

B) .a configuration defines a Vertical Set of classes That a profile.

C) .a configuration defines a Minimum Set of Class Libraries for a Wide Range of Devices, And A Profile Defines The Set of Apis Available for a Particular Family of Devices.

D) .a profile is the Foundation for a configuration.

9. All MIDP IMPLEMENTATIONS Are Required To Support What Image Format?

A) .gif

B) .jpg

C) .bmp

D) .png

10. IF a MIDLET NEEDS TO RECEIVE High-Level Events from The Implementation, Which Interface Should IT IT ITLEMENT?

A) .actionListener

B) .commandlistener

C) .windows listener

D) .choicelistener

11. All Midp GUI CLASSES Are Contained in What package?

A) .javax.microedition.gui

B) .javax.microedition.lcd

C) .javax.microedition.lcdui

D) .javax.microedition.display

12. The MIDP User Interface API Is A Subset of the AWT / Project Swing Libraries.

A) .true

B) .false

13. Which Class Would You Use to Write Applications To Issue Graphics Calls for Drawing To The Display?

A) .display

B) .command

C) .screen

D) .canvas

14. Which of the folloading statements is true regarding the generic connection framework:

A) .The CLDC Provides An Implementation for The Http Protocol.

B) .all MIDP IMPLEMENTATIONS MUST Provide Support for the Http Protocol.

C) .THE MIDP Provides Implementation for DataGram and Socket Connectionsd) .the Connection Interface IS Part of The Java.net Package.

15. The Heart of the Generic Connection Framework is:

A) .javax.microedition.Connection

B) .javax.microedition.Connector

C) .javax.microedition.streamConnection

D) .javax.microedition.httpConnection

16. What is The Correct Syntax, Using The Generic Connection Framework, To Open AN HTTP Connection:

A) .connection c = connection.open ("http://developer.java.sun.com");

B) .connector c = connector.open ("http://developer.java.sun.com");

C) .connection c = connector.open ("http://developer.java.sun.com");

D) .connector c = connection.open ("http://developer.java.sun.com");

17. The Midp Provides a Mechanism for Midlets to Persistently Store Data IN A Platform-Dependent File and Retrieve It Later. This Mechanism IS:

A). Object Serialization

B) .jdbc

C) .rms

D) .odbc

18. A Java Virtual Machine1 (JVM) Supporting CLDC HAS No Support for:

A) .floating points Numbers

B) .reflection

C) .jni

D) .all of the Above

19. Which of the folload Non-Exception Classes Are Inherited from the Java 2 Standard Edition 1.3 Java.util package by the CLDC:

A) .calendar, date, enumeration, hashtable, stack, vector

B) .calendar, Date, Enumeration, Hashtable, Random, Stack, Timer, Vector

C) .calendar, Date, Enumeration, Hashtable, Stack, Vector, StringTokenzier

D) .all of the java.util classes is inherited

20. Which of the following techniques can be used for Wireless Session TRACKING?

A) .COOKIES

B) .url Rewriting

C )hidden Fields

D) .none of the Above

Two .MIDP quiz answers

1. A MIDLET IS A Java Class That Extends The Abstract Class Class

Answer (C) is correct. At the basic level, a midlet is a Java class that extends the javax.microedition.midlet.MIDlet abstract class. Inheriting from this class and providing implementation for some specific methods makes that Java class a midlet that may Run in a Midlet application manager.2. Which of the folloading methods of the midlet Abstract Class Must Be Impletion by a MIDlet:

Answer (C) is correct. A midlet extending the MIDlet abstract class must implement the startApp, pauseApp, and destroyApp methods. These methods are analogous to the start, stop, and destroy methods of the Applet class.

3.After compling your midlet, You Must Process It with a command to ensure That it is valid before us by the kilo virtual machine (kVM). What is the name of what command?

Answer (C) is correct. In the J2SE Java virtual machine1, the class verifier is responsible for rejecting invalid class files. A JVM supporting CLDC must be able to reject invalid class files as well, however, the class verification process is expensive and time consuming;. therefore, not ideal for small, resource-constrained devices The KVM designers decided to move most of the verification work off the device and onto the desktop, where the class files are compiled onto a server machine from which applications are being downloaded. .

4. A Java Application Descriptor (JAD) file is a text file that is similar to a manifest, except that it is not packaged in a JAR file Some of the shared attributes that must have identical values ​​are:. MIDlet-Name, MIDlet- . Version, and MIDlet-Vendor If any shared attributes are different, then: Answer (A) is correct The use of JAD files is optional but recommended It enables the device to verify things like whether the JAR file is too big for the.. Device, WHETHER A New Version of The Midlet Suite IS Already Installed on The Device, etc.

5. When Downloading Application Descriptors (.jad Files) from A Web Server, The Web Server Must Return A Mime Type of:

.. Answer (C) is correct The server must return a MIME type of text / vnd.sun.j2me.app-descriptor For Apache servers, you can enable this by adding the following line to the httpd.conf file: AddType text / VND.Sun.j2me.app-descriptor .jad.

6. A MIDlets Suite Is A Set of Midlets That Are PackageD TOGETHER INTO A SINGLE JAR File. Midlets within the Same Suite

. Answer (A) is correct Midlet suites are special since midlets in the same suite can share the classes and resources contained in the JAR file