Olete.in
Articles
Mock Tests
🧪 J2ME MCQ Quiz Hub
J2ME Mcq Question Set 1
Choose a topic to test your knowledge and improve your J2ME skills
1. What exception is thrown when Servlet initialization fails ?
IOException
ServletException
RemoteException
None of the mentioned
2. How can a Servlet call a JSP error page ?
This capability is not supported.
When the servlet throws the exception, it will automatically be caught by the calling JSP page.
The servlet needs to forward the request to the specific error page URL. The exception is passed along as an attribute named "javax.servlet.jsp.jspException".
The servlet needs to redirect the response to the specific error page, saving the exception off in a cookie.
3. What is the key difference between using a and HttpServletResponse.sendRedirect()?
forward executes on the client while sendRedirect() executes on the server.
forward executes on the server while sendRedirect() executes on the client.
The two methods perform identically.
All of the Mentioned
4. Why beans are used in J2EE architecture in stead of writing all the code in JSPs ?
Allows separation of roles between web developers and application developers
Allows integration with Content Management tools
all of the above
None of the mentioned
5. Purpose of tag
used to incorporate Java applets into a Web page.
Downloads a plugin to the client Web browser to execute an applet or Bean.
both (a) & (b)
None of the mentioned
6. The time between Command Execution and Response is called ______
Granularity
Latency
Lag time
None of the mentioned
7. At what stage, the life cycle of a CMP bean can be assumed to be started ?
before ejbCreate() method is executed
after ejbCreate() method is executed
in postCreate() method
after executing ejbStore()
8. In JSP, how can you know what HTTP method (GET or POST) is used by client request ?
by using request.getMethod()
by using request.setMethod()
impossible to know
None of the mentioned
9. What is legal about JSP scriplets
A loop can begin in one Scriptlet and end in another
Statements in Scriptlets should follow Java Syntax
Semicolon is needed at the end of each statement in a Scriptlet
all the above
10. Which method is called first each time a Servlet is invoked ?
Start()
Run()
Servive()
init()
11. Which of the following statements is true about Java ME?
Java ME is a single specification.
Java ME is a family of related specifications.
Java ME is a platform for creating applications for the well-established desktop market.
Java ME is a platform for creating server-side enterprise applications.
12. What is a configuration?
A configuration defines a set of class libraries available for a particular domain of devices.
A configuration defines a vertical (or specialized) set of classes.
A configuration defines a minimum set of class libraries for a wide range of devices.
All of the above.
13. What is a profile?
A profile defines a set of class libraries available for a wide range of devices.
A profile defines a horizontal set of classes that a configuration can use.
A profile defines the set of APIs available for a particular family of devices.
A profile is the foundation for a configuration.
14. The Personal Digital Assistant (PDA) Profile is based on:
Connected Device Configuration (CDC).
Connected Limited Device Configuration (CLDC).
all of the above
None of the mentioned
15. The Foundation profile:
Extends the CDC by adding the missing user interface APIs.
Extends the CLDC by adding the missing Java 2, Standard Edition (J2SE) core libraries.
Is meant to serve as a foundation for other profiles.
All of the above.
16. The RMI profile is meant to be used with:
CLDC and MIDP
CDC and Foundation
Both A and B
None of the mentioned
17. The CLDC does not address user interface issues. They are left to be handled by the:
Foundation profile
Personal profile
Mobile Information Device Profile (MIDP)
none of the above
18. Which of the following network connections is supported by MIDP?
UDP datagrams
WAP
HTTP
All of the above
19. A Java ME-enabled device:
Can support only a single profile
Can support multiple profiles
all of the above
None of the mentioned
20. A device that currently uses CLDC (and therefore has a profile) can use that profile with CDC without modification.
True
False
all of the above
None of the mentioned
21. In the CDC, user interface issues are handled by the:
Foundation profile
Personal profile
Mobile Information Device Profile (MIDP)
none of the above
22. The CDC targets devices with _______ of total memory available for the Java platform, including both RAM and flash or ROM.
160 KB
256 KB
512 KB
2 MB or More
23. The Java Virtual Machine1 specified to be used with the CDC is:
KVM
CVM
PVM
None of the mentioned
24. In MIDP, the maximum length of a record store name is:
8 characters
32 characters
128 characters
No limit on the length of a record store name
25. . Is it possible to determine the contents of a JAR file before is it downloaded to a device?
No, it is not.
Yes, by inspecting the associated JAD file.
all of the above
None of the mentioned
26. The CDC and Foundation make corrections to the J2SE libraries by removing all noncritical, deprecated APIs.
True
False
all of the above
None of the mentioned
27. Which of the following network connections is supported by the CDC?
UDP datagrams
TCP sockets
HTTP connections
none of the above
28. Which of the following network connections is supported by the Foundation profile?
UDP datagrams
TCP sockets
HTTP
All of the above
29. What compilation option should be used when compiling Java ME applications?
-classpath
-bootclasspath
-preverify
Any of the above
30. Which of the following areas are being investigated by the MIDP Next Generation?
HTTPS and secure networking
Network connectivity through sockets and datagrams
Extensions to the low-level user interface APIs to allow greater game functionality
none of the above
31. A midlet is a Java class that extends the abstract class:
javax.microedition.MIDlet
javax.microedition.midlet
javax.microedition.midlet.MIDlet
javax.microedition.midlet.midlet
32. Which one of the following methods of the MIDlet abstract class must be implemented by a midlet:
initApp, startApp
startApp, destroyApp
startApp, pauseApp, destroyApp
initApp, startApp, pauseApp, destroyApp
33. After compiling your midlet, you must process it with a command to ensure that it is valid before use by the Kilo virtual machine (KVM). What is the name of that command?
midp
javac-bootclasspath
preverify
jar
34. 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:
The ones in the descriptor override those in the manifest
The ones in the manifest override those in the descriptor
all of the above
None of the mentioned
35. When downloading application descriptors (.jad files) from a web server, the web server must return a MIME type of:
text/vnd.sun.j2me.midp
text/vnd.sun.j2me.jad
text/vnd.sun.j2me.app-descriptor
text/vnd.sun.j2me.midapp
36. A midlet suite is a set of midlets that are packed together into a single JAR file. Midlets within the same suite:
Can share the classes and resources contained in the JAR file
Cannot share the classes and resources contained in the JAR file
all of the above
None of the mentioned
37. Midlets from different suites:
Can interact directly.
Cannot interact directly.
all of the above
None of the mentioned
38. What is the difference between a configuration (such as the CLDC) and a profile (such as the MIDP)?
a configuration defines the set of class libraries available for a particular domain of devices, and a profile provides I/O and network APIs.
a configuration defines a vertical set of classes that a profile can use.
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.
A profile is the foundation for a configuration.
39. All MIDP implementations are required to support what image format?
GIF
JPG
BMP
PNG
40. If a midlet needs to receive high-level events from the implementation, which interface should it implement?
ActionListener
CommandListener
Windows Listener
ChoiceListener
41. All MIDP GUI classes are contained in what package?
javax.microedition.gui
javax.microedition.lcd
javax.microedition.lcdui
javax.microedition.display
42. The MIDP user interface API is a subset of the AWT/ Project Swing libraries.
True
False
all of the above
None of the mentioned
43. Which class would you use to write applications to access low-level input events or to issue graphics calls for drawing to the display?
Display
Command
Screen
Canvas
44. Which of the following statements is true regarding the Generic Connection framework:
The CLDC provides an implementation for the HTTP protocol.
All MIDP implementations must provide support for the HTTP protocol.
The MIDP provides implementation for datagram and socket connections.
The Connection interface is part of the java.net package.
45. The heart of the Generic Connection framework is:
javax.microedition.Connection
javax.microedition.Connector
javax.microedition.StreamConnection
javax.microedition.HttpConnection
46. What is the correct syntax, using the Generic Connection framework, to open an HTTP connection:
Connection c = Connection.open("http://developer.java.sun.com");
Connector c = Connector.open("http://developer.java.sun.com");
Connection c = Connector.open("http://developer.java.sun.com");
Connector c = Connection.open("http://developer.java.sun.com");
47. The MIDP provides a mechanism for MIDlets to persistently store data in a platform-dependent file and retrieve it later. This mechanism is:
Object Serialization
JDBC
RMS
ODBC
48. A Java virtual machine1 (JVM) supporting CLDC has no support for:
Floating point numbers
Reflection
JNI
All of the above
49. Which of the following non-exception classes are inherited from the Java 2 Standard Edition 1.3 java.util package by the CLDC:
Calendar, Date, Enumeration, Hashtable, Stack, Vector
Calendar, Date, Enumeration, Hashtable, Random, Stack, Timer, Vector
Calendar, Date, Enumeration, Hashtable, Stack, Vector, StringTokenzier
All of the java.util classes are inherited
50. Which of the following techniques can be used for wireless session tracking?
Cookies
URL Rewriting
Hidden Fields
none of the above
Submit