Advanced Java Set 3
On This Page
This set of Advanced JAVA Multiple Choice Questions & Answers (MCQs) focuses on Advanced Java Set 3
Q1 | Which of these variables stores the number of hits that are successfully servedout of cache?
- hits
- hitstocache
- hits_to_cache
- hits.to.cache
Q2 | Which of these method of httpd class is used to write UrlCacheEntry object intolocal disk?
- writediskcache()
- writetodisk()
- writecache()
- writediskentry()
Q3 | Which of these is an instance variable of class httpd?
- port
- cache
- log
- all of the mentioned
Q4 | Which of these is an instance variable of httpd that is a Hashtable?
- port
- cache
- log
- stopflag
Q5 | Which of these exception is thrown by URL class’s constructors?
- urlnotfound
- urlsourcenotfound
- malformedurlexception
- urlnotfoundexception
Q6 | Which of these methods is used to know host of an URL?
- host()
- gethost()
- gethost()
- gethost()
Q7 | Which of these methods is used to know the full URL of an URL object?
- fullhost()
- gethost()
- externalform()
- toexternalform()
Q8 | Which of these class is used to access actual bits or content information of aURL?
- url
- urldecoder
- urlconnection
- all of the mentioned
Q9 | Which object of HttpSession can be used to view and manipulate informationabout a session?
- session identifier
- creation time
- last accessed time
- all mentioned above
Q10 | Which of these ways used to communicate from an applet to servlet?
- rmi communication
- http communication
- socket communication
- all mentioned above
Q11 | Which methods are used to bind the objects on HttpSession instance andgetthe objects?
- setattribute
- getattribute
- both a & b
- none of the above
Q12 | Which type of ServletEngine is a server that includes built-in support forservlets?
- add-on servletengine
- embedded servletengine
- standalone servletengine
- none of the above
Q13 | What type of servlets use these methods doGet(), doPost(),doHead, doDelete(),doTrace()?
- genereic servlets
- httpservlets
- all of the above
- none of the above
Q14 | Which cookie it is valid for single session only and it is removed each timewhen the user closes the browser?
- persistent cookie
- non-persistent cookie
- all the above
- none of the above
Q15 | Which action tags are used in JSP for developing web application with JavaBean?
- jsp:usebean
- jsp:setproperty
- jsp:getproperty
- both b & c
Q16 | Which technology do we mix our business logic with the presentation logic?
- servlet
- jsp
- both a & b
- none of the above
Q17 | Which tag is used to execute java source code in JSP?
- declaration tag
- scriptlet tag
- expression tag
- none of the above
Q18 | Which JSP Action tags is used to include the content of another resource,itMay be jsp, html or servlet?
- jsp:include
- jsp:forward
- jsp:plugin
- jsp:papam
Q19 | In JSP how many ways are there to perform exception handling?
- 3
- 2
- 4
- 5
Q20 | In JSP page directive which attribute defines theMIME(MultipurposeInternet Mail Extension) type of the HTTP response?
- import
- content type
- extends
- info
Q21 | A JSP page consists of which tags?
- html tags
- jsp tags
- both a & b
- none of the above
Q22 | What alternatives exist to embedding Java code directly within the HTMLmarkup of your JSP page?
- moving the code into your session manager.
- moving the code into scriptlets.
- moving the code into javabeans and servlets.
- moving the code into a transaction manager.
Q23 | What type of scriptlet code is better-suited to being factored forward into aservlet?
- code that deals with logic that is common across requests.
- code that deals with logic that is vendor specific)
- code that deals with logic that relates to database access.
- code that deals with logic that relates to client scope.
Q24 | URL encoding is the method of replacing all the spaces and other extracharacters into their corresponding _______ Characters?
- hex
- binary
- octal
- decimal
Q25 | Which of the scripting of JSP not putting content into service method of theconverted servlet?
- declarations
- scriptlets
- expressions
- none of the above