188
99.7k

180+ Enterprise Computing With JAVA Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Master of Computer Applications (MCA) .

Chapters

Chapter: Unit 2
51.

Which of the following are examples of JSP directive? Select the two correct answers.

A. include
B. exclude
C. import
D. taglibrary
Answer» A. include
52.

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» B. import
53.

A JSP page needs to generate an XML file. Which attribute of page directive may be used to specify that the JSP page is generating an XML file?

A. contentType
B. generateXML
C. type
D. outputXML
Answer» A. contentType
54.

JSP pages have access to implicit objects that are exposed automatically. Name the implicit object that is of type HttpSession.

A. session
B. application
C. httpSession
D. httpsession
Answer» A. session
55.

JSP pages have access to implicit objects that are exposed automatically. One such object that is available is request. The request object is an instance of which class?

A. HttpRequest
B. ServletRequest
C. Request
D. HttpServletRequest
Answer» D. HttpServletRequest
56.

What is the limitation of creating ActionServlet instances per web application?

A. Two
B. Three
C. Unlimited
D. One
Answer» A. Two
57.

ActionServlet, RequestProcessor and Action classes are the components of

A. View
B. Model
C. Deployment
D. Controller
Answer» D. Controller
58.

Which of the java bean tags is used to show the bean value on the web page?

A. < bean:define>
B. < bean:message>
C. < bean:show>
D. < bean:write>
Answer» D. < bean:write>
59.

Which of the following are server side programming languages? 1.HTML 2.JavaScript 3.JSP 4.Sevlets

A. 1,2,3,4
B. 1,2
C. 3,4
D. None
Answer» C. 3,4
60.

What JSP is basically used today?

A. To make controller
B. To make GUI
C. In writing business logic
D. Deprecated
Answer» B. To make GUI
61.

What is the purpose of <noscript> tag in Java Script?

A. Prevents scripts on the page from executing.
B. Enclose text to be displayed by non –JavaScript browsers.
C. Suppresses the result to be displayed on the web page.
D. None of the above.
Answer» B. Enclose text to be displayed by non –JavaScript browsers.
62.

Java Script entities start with ___________and end with _____________

A. Semicolon, colon
B. Semicolon, Ampersand
C. Ampersand, colon
D. Ampersand, semicolon.
Answer» D. Ampersand, semicolon.
63.

Which of the following is a server-side Java Script object?

A. Function
B. File
C. FileUpload
D. Date
Answer» B. File
64.

Which of the following is a client-side Java Script object?

A. Function
B. File
C. FileUpload
D. Date
Answer» C. FileUpload
65.

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» C. var salaries = new Array(39438, 39839,83729)
66.

Which of the following syntax is correct to refer an external script called “formValidation.js”?

A. <script href = “formValidation.js”>
B. <script source = “formValidation.js”>
C. <script name = “formValidation.js”>
D. <script src = “formValidation.js”>
Answer» D. <script src = “formValidation.js”>
67.

What is the alternate name for Java script?

A. LimeScript
B. Both a and d
C. ECMScript
D. ECMAScript
Answer» D. ECMAScript
68.

What type of image map could be used with Java Script?

A. Client-side image maps
B. Server-side image maps.
C. Both A and B
D. Localhost image maps
Answer» A. Client-side image maps
69.

Which of the following are capable of Java Script functions?

A. Returning multiple values
B. Accepting parameters and returning values
C. Accepting parameters
D. All choices are correct
Answer» C. Accepting parameters
70.

Which of the following is not a valid JavaScript variable name?

A. 2java
B. _java_and_java_names
C. Javaandjava
D. None of the above
Answer» A. 2java
71.

What java wrapper type is created when a JavaScript object is sent to Java?

A. ScriptObject
B. JavaObject
C. Jobject
D. JSObject
Answer» D. JSObject
72.

Which of the following is correct to write “Hello World ” on the web page?

A. System.out.println(“Hello World”)
B. print(“Hello World”)
C. document.write(“Hello World”)
D. response.write(“Hello World”)
Answer» C. document.write(“Hello World”)
73.

How does Java Script store dates in objects of Date type?

A. The number of days since 1st, 1900
B. The number of seconds since January 1st, 1970
C. The number of milliseconds since January 1st, 1970
D. The number of picoseconds since January 1st, 1970
Answer» C. The number of milliseconds since January 1st, 1970
74.

Which attribute needs to be changed to make elements invisible?

A. Visibility
B. Visible
C. Invisibility
D. Invisible
Answer» A. Visibility
75.

Which machine actually executed the Java Script?

A. The web server
B. The machine which is running a web server.
C. Java Script engine
D. Both A and C
Answer» B. The machine which is running a web server.
76.

Which attribute is used to hold the Java Script Version?

A. SCRIPT
B. VERSION
C. LANGUAGE
D. VER
Answer» C. LANGUAGE
77.

JavaScript RegExp Object has modifier 'i' to __________

A. Perform case-sensitive matching
B. Perform case-insensitive matching
C. Perform both case-sensitive&case-insensitive matching
D. None of above
Answer» B. Perform case-insensitive matching
78.

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» D. Only one
79.

Which of the following delegates the request handling to the RequestProcessor instance?

A. ActionServlet
B. Action class
C. Deployment descriptor
D. None of the above
Answer» A. ActionServlet
80.

How many instances can be created per application module by the RequestProcessor class?

A. Four
B. Three
C. One
D. Uncountable instances
Answer» C. One
81.

An instance of Action is invoked by

A. ActionServlet
B. ActionListener
C. RequestProcessor
D. All of the above
Answer» C. RequestProcessor
82.

Application module selection is done by

A. Action class
B. ActionServlet
C. RequestProcessor
D. All of the above
Answer» B. ActionServlet
83.

Which of the following methods is overridden by Action class?

A. execute()
B. service()
C. run()
D. destroy()
Answer» A. execute()
84.

Which of the following should always forwards or redirect to a resource (view) after completed?

A. HttpResponse object
B. ActionServlet
C. Action class
D. Request Processor
Answer» D. Request Processor
85.

Which of the following acts as a bridge between user-invoked URI and a business method?

A. HttpRequest
B. Action class
C. ActionServlet
D. RequestProcessor
Answer» B. Action class
86.

Struts framework

A. should always decouple the application from a specific model implementation
B. provides model components
C. does not support JavaBeans and EJB
D. has built-in support for the model
Answer» A. should always decouple the application from a specific model implementation
87.

Which of the following tags in struts-config.xml file defines the availability of necessary Struts JSP custom tag libraries?

A. < jsp-lib>
B. < struts-taglib>
C. < taglib>
D. < jsp-taglib>
Answer» C. < taglib>
88.

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» D. Vs.JavaScript
89.

Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

A. The ErrorPage Attribute
B. The IsErrorPage Attribute
C. Both A & B
D. None of the above
Answer» B. The IsErrorPage Attribute
90.

What technique is used for the authentication mechanism in the servlet specification?

A. Role Based Authentication
B. Form Based Authentication
C. Both A & B
D. None of the above
Answer» A. Role Based Authentication
91.

In JSP Action tags which tags are used for bean development?

A. jsp:useBean
B. jsp:setPoperty
C. jsp:getProperty
D. All mentioned above
Answer» D. All mentioned above
92.

Which two interfaces does the javax.servlet.jsp package have?

A. JspPage
B. HttpJspPage
C. PageContext
D. Both A & B
Answer» D. Both A & B
93.

Which of the following is an advantage of the statement – Separation of business logic from JSP?

A. Custom Tags in JSP
B. JSP Standard Tag Library
C. All the above
D. None of the above
Answer» A. Custom Tags in JSP
94.

JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you can do with Java servlets.

A. True
B. False
C. none
D. all
Answer» A. True
95.

How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?

A. 8
B. 9
C. 10
D. 7
Answer» B. 9
96.

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» A. True
97.

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» D. Both B & C
Chapter: Unit 3
98.

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» B. The EJB architecture is the standard component architecture for building distributed business applications in the Java programming language. (*)
99.

Which statement about life-cycle callback methods is correct?

A. Life-cycle callback methods must be implemented in the bean class.
B. Life-cycle callback methods can have public, private, protected, or packagelevel access. (*)
C. A life-cycle callback method can only have a single callback annotation. In other words, you cannot define a single method and give it two different callback annotations.
D. Life-cycle callback methods can be declared as static.
Answer» B. Life-cycle callback methods can have public, private, protected, or packagelevel access. (*)
100.

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» D. CMP (Container Managed Persistence) Entity Bean

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.