Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. Which methods are used to bind the objects on HttpSession instance andgetthe objects?
a. setattribute
b. getattribute
c. both a & b
d. none of the above
Q. Which type of ServletEngine is a server that includes built-in support forservlets?
a. add-on servletengine
b. embedded servletengine
c. standalone servletengine
d. none of the above
Q. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(),doTrace()?
a. genereic servlets
b. httpservlets
c. all of the above
d. none of the above
Q. Which cookie it is valid for single session only and it is removed each timewhen the user closes the browser?
a. persistent cookie
b. non-persistent cookie
c. all the above
d. none of the above
Q. Which action tags are used in JSP for developing web application with JavaBean?
a. jsp:usebean
b. jsp:setproperty
c. jsp:getproperty
d. both b & c
Q. Which technology do we mix our business logic with the presentation logic?
a. servlet
b. jsp
c. both a & b
d. none of the above
Q. Which tag is used to execute java source code in JSP?
a. declaration tag
b. scriptlet tag
c. expression tag
d. none of the above
Q. Which JSP Action tags is used to include the content of another resource,itMay be jsp, html or servlet?
a. jsp:include
b. jsp:forward
c. jsp:plugin
d. jsp:papam
Q. In JSP page directive which attribute defines theMIME(MultipurposeInternet Mail Extension) type of the HTTP response?
a. import
b. content type
c. extends
d. info
Q. What alternatives exist to embedding Java code directly within the HTMLmarkup of your JSP page?
a. moving the code into your session manager.
b. moving the code into scriptlets.
c. moving the code into javabeans and servlets.
d. moving the code into a transaction manager.
Q. What type of scriptlet code is better-suited to being factored forward into aservlet?
a. code that deals with logic that is common across requests.
b. code that deals with logic that is vendor specific)
c. code that deals with logic that relates to database access.
d. code that deals with logic that relates to client scope.
Q. URL encoding is the method of replacing all the spaces and other extracharacters into their corresponding _______ Characters?
a. hex
b. binary
c. octal
d. decimal
Q. Which of the scripting of JSP not putting content into service method of theconverted servlet?
a. declarations
b. scriptlets
c. expressions
d. none of the above