

MCQOPTIONS
Saved Bookmarks
This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
51. |
An instance of Action is invoked by |
A. | ActionServlet |
B. | ActionListener |
C. | RequestProcessor |
D. | All of above |
Answer» B. ActionListener | |
52. |
Which of the following regarding business methods in a bean class is incorrect? |
A. | Both session bean and entity bean business methods are always same |
B. | For Java RMI API, the argument and return types must always be legal types |
C. | The throws clause may include any exceptions defined by your application. |
D. | None of the above |
Answer» C. The throws clause may include any exceptions defined by your application. | |
53. |
Which of the following is true about EJB transactions? |
A. | Nested transactions are supported by EJB 2.0 |
B. | Isolation levels specification is supported by EJB 2.0 |
C. | Bean-managed transaction demarcation must not be used in Message-driven beans |
D. | Bean-managed transaction demarcation must not be used in Entity beans |
Answer» E. | |
54. |
Which of the following is a client-side Java Script object? |
A. | Function |
B. | File |
C. | FileUpload |
D. | Date |
Answer» D. Date | |
55. |
Which of the following is the correct way for writing Java Script array? |
A. | var salaries = new Array(1:39438, 2:39839 3:83729) |
B. | var salaries = new (Array1=39438, Array 2=39839 Array 3=83729) |
C. | var salaries = new Array(39438, 39839,83729) |
D. | var salaries = new Array() values = 39438, 39839 83729 |
Answer» D. var salaries = new Array() values = 39438, 39839 83729 | |
56. |
Which of the following is the format for EJB deployment descriptor files? |
A. | XML |
B. | XSL |
C. | HTML |
D. | Java |
Answer» B. XSL | |
57. |
Which of the following types of Enterprise Java Bean will be most likely to be difficult to port from one App Server to another? |
A. | Stateful Session Beans |
B. | Stateless Session Bean |
C. | BMP (Bean Managed Persistence) Entity Bean |
D. | CMP (Container Managed Persistence) Entity Bean |
Answer» E. | |
58. |
What is the limit of data to be passed from HTML when doGet() method is used? |
A. | 4K |
B. | 8K |
C. | 2K |
D. | 1K |
Answer» D. 1K | |
59. |
Servlet technology is used to create web application? |
A. | True |
B. | False |
C. | all |
D. | none |
Answer» B. False | |
60. |
In HTTP Request method Get request is secured because data is exposed in URL bar? |
A. | True |
B. | False |
C. | all |
D. | none |
Answer» C. all | |
61. |
Given the following code in a stateful session bean business method; try { Socket skt = new Socket(x,y); } catch (Exception ex) { ex.printStackTrace(); } Assuming that x and y are the port and IP addresses respectively of a running service, which is running on the same server, which of the following is correct? |
A. | Failure in Compilation |
B. | Failure in Deployment |
C. | An exception is thrown at runtime |
D. | Indeterminate. The code is not guaranteed to be ported to all EJB 2.0 containers, though it may deploy. |
Answer» E. | |
62. |
Which role in EJB architecture is responsible for EJB Server? |
A. | EJB Deployer |
B. | Application Assembler |
C. | Network Engineer |
D. | Server Provider |
Answer» E. | |
63. |
What java wrapper type is created when a JavaScript object is sent to Java? |
A. | ScriptObject |
B. | JavaObject |
C. | Jobject |
D. | JSObject |
Answer» E. | |
64. |
Dynamic interception of requests and responses to transform the information is done by |
A. | servlet container |
B. | servlet config |
C. | servlet context |
D. | servlet filter |
Answer» E. | |
65. |
Which two interfaces does the javax.servlet.jsp package have? |
A. | JspPage |
B. | HttpJspPage |
C. | PageContext |
D. | Both A & B |
Answer» E. | |
66. |
The include() method of RequestDispatcher |
A. | sends a request to another resource like servlet, jsp or html |
B. | includes resource of file like servlet, jsp or html |
C. | appends the request and response objects to the current servlet |
D. | None of the above |
Answer» C. appends the request and response objects to the current servlet | |
67. |
A JSP page uses the java.util.ArrayList class many times. Instead of referring the class by its complete package name each time, we want to just use ArrayList. Which attribute of page directive must be specified to achieve this? Select the one correct answer. |
A. | extends |
B. | import |
C. | include |
D. | package |
Answer» C. include | |
68. |
Which of the following is not an implicit object in JSP?I. Request. II. Session. III. Vector. IV. In. |
A. | Both (I) and (II) above |
B. | Both (II) and (III) above |
C. | Both (I) and (III) above |
D. | Both (III) and (IV) above. |
Answer» E. | |
69. |
Which statement correctly identifies the goals of the designers of the EJB architecture? |
A. | The EJB architecture requires that users be aware of the low-level transaction details of the Java EE platform. |
B. | The EJB architecture is the standard component architecture for building distributed business applications in the Java programming language. (*) |
C. | Although the EJB architecture defines the contracts that enable tools to develop and deploy components, each application server vendor must produce its own set of additional tooling. |
D. | The EJB architecture provides a standard way of persisting state data using the Java Persistence API, Java Data Objects, and JDBC. |
Answer» C. Although the EJB architecture defines the contracts that enable tools to develop and deploy components, each application server vendor must produce its own set of additional tooling. | |
70. |
Which interface should be implemented by a stateful session bean if it needs to synchronize its conversational state with the transactional context? |
A. | javax.transaction.UserTransaction |
B. | javax.ejb.SessionSynchronization |
C. | javax.ejb.EJBContext |
D. | javax.transaction.TransactionContext |
Answer» C. javax.ejb.EJBContext | |
71. |
Which is not a valid scope for Java bean in JSP? |
A. | Page |
B. | Session |
C. | Request |
D. | Global. |
Answer» E. | |
72. |
Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns? |
A. | Stateful Session Bean |
B. | Stateless Session Bean |
C. | Singleton Session Bean |
D. | None of the above |
Answer» D. None of the above | |
73. |
Which of the following is an approach for state maintenance in Web applications? |
A. | Hidden Form Field |
B. | URL Rewriting |
C. | Cookies |
D. | All of the above. |
Answer» E. | |
74. |
Which of the following is not true for servlet? |
A. | It is persistent |
B. | Platform independent |
C. | High performance |
D. | It is single threaded. |
Answer» E. | |
75. |
Which of the following EJB type has no Remote interfaces? |
A. | Message-Driven Bean |
B. | BMP Entity Bean |
C. | CMP Entity Bean |
D. | none |
Answer» B. BMP Entity Bean | |
76. |
ActionServlet, RequestProcessor and Action classes are the components of |
A. | View |
B. | Model |
C. | Deployment |
D. | Controller |
Answer» E. | |
77. |
Which of the following are guaranteed capabilities of EJB 2.0? |
A. | Run-as security identity functionality. |
B. | The extension of JDBC 2.0 |
C. | Both A and B |
D. | Neither A nor B |
Answer» D. Neither A nor B | |
78. |
Which one of the following objects is passed to a Java Bean when one of its properties isset via a JSP action? |
A. | Servlet Request |
B. | Http Servlet Request |
C. | Servlet Response |
D. | Http Servlet Response |
Answer» D. Http Servlet Response | |
79. |
How many instances can be created per application module by the RequestProcessor class? |
A. | Four |
B. | Three |
C. | One |
D. | Uncountable instances |
Answer» D. Uncountable instances | |
80. |
JMS is mainly used to send and receive message from one application to another. |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» B. False | |
81. |
Which of the following property of Java Bean represents a single value? |
A. | Simple property |
B. | Boolean property |
C. | Indexed property |
D. | Both (a) and (b) above |
Answer» E. | |
82. |
Which can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc. in JSP? |
A. | vs.Static HTML |
B. | vs.Server-Side Includes |
C. | vs.Pure Servlets |
D. | Vs.JavaScript |
Answer» E. | |
83. |
Which is least visibility scope for Java bean in JSP? |
A. | Page |
B. | Session |
C. | Request |
D. | Application |
Answer» B. Session | |
84. |
What represents a persistent global data from the database? |
A. | Entity Bean |
B. | Session Bean |
C. | Both A & B |
D. | None of the above |
Answer» B. Session Bean | |
85. |
JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI) |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» B. False | |
86. |
How many ServletContext objects are available for an entire web application? |
A. | One each per servlet |
B. | One each per request |
C. | One each per response |
D. | Only one |
Answer» E. | |
87. |
Choose the incorrect statement from the following about Home methods in a bean classfor CMP (Container Managed Persistence). |
A. | The throws clause of the method may include the java.rmi.RemoteException. |
B. | Relationships must not be accessed by the method |
C. | The persistence state of the bean must not be accessed by the method |
D. | The static declaration can not be done for the method. |
Answer» B. Relationships must not be accessed by the method | |
88. |
Which object is used to forward the request processing from one servlet to another? |
A. | ServeltContext |
B. | ServletConfig |
C. | RequestDispatcher |
D. | ResponseDispatcher |
Answer» D. ResponseDispatcher | |
89. |
Which JSP tag is used to transfer processing to another JSP page? |
A. | <jsp:include> |
B. | <jsp:forward> |
C. | <jsp:redirect> |
D. | <jsp:useBean> |
Answer» C. <jsp:redirect> | |
90. |
In the HTTP Request method which is non-idempotent? |
A. | GET |
B. | POST |
C. | BOTH A & B |
D. | None of the above |
Answer» C. BOTH A & B | |
91. |
Which of the following distributed object technology is/are not included in Java?I. CORBA. II. DCOM. III. RMI. IV. EJB. |
A. | Only (I) above |
B. | Only (II) above |
C. | Only (III) above |
D. | Only (IV) above |
Answer» C. Only (III) above | |
92. |
The method forward (request,response) will |
A. | return back to the same method from where the forward was invoked |
B. | not return back to the same method from where the forward was invoked and the web pages navigation continues |
C. | Both A and B are correct |
D. | None of the above |
Answer» B. not return back to the same method from where the forward was invoked and the web pages navigation continues | |
93. |
A session bean represents a multiple clients inside the Application Server. |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» C. none | |
94. |
Which statement characterizes stateless session beans? |
A. | They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks. |
B. | They require home interfaces. |
C. | When a client looks up a stateful session bean in the JNDI, the same bean is returned every time. |
D. | They are asynchronous message consumers. |
Answer» B. They require home interfaces. | |
95. |
The getSession() method with ‘true’ as its parameter [ getSession(true) ] it will return the appropriate session object when |
A. | the session is completed |
B. | the session object is passed to another method |
C. | the session does not exists |
D. | the session is existing |
Answer» E. | |
96. |
Struts framework is based on |
A. | Servlet.JSP and Java |
B. | Servlet,.HTML and Java |
C. | Servlet JSP, XML and Java |
D. | Applet, XML and Java |
Answer» B. Servlet,.HTML and Java | |
97. |
Which of the following is true for Java Bean? |
A. | It can not be a GUI component |
B. | It never implements serializable interface |
C. | It has zero-argument constructor |
D. | It is a distributed component |
Answer» D. It is a distributed component | |
98. |
EJB system’s performance tuning is the responsibility of |
A. | Bean Provider |
B. | EJB Deployer |
C. | Application Assembler |
D. | Tool Vendor |
Answer» C. Application Assembler | |
99. |
Which of the following can be directly invoked by the client? |
A. | ejbPassivate |
B. | business methods |
C. | setSessionContext |
D. | newInstance |
Answer» C. setSessionContext | |
100. |
Which action tags are used in JSP for developing web application with Java Bean? |
A. | jsp:useBean |
B. | jsp:setProperty |
C. | jsp:getProperty |
D. | Both B & C |
Answer» E. | |