Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. Which of these method is used to start a server thread?
a. run()
b. start()
c. runthread()
d. startthread()
Q. Which of these method is called when http daemon is acting like a normal webserver?
a. handle()
b. handleget()
c. handleget()
d. handleget()
Q. Which of these methods of httpd class is used to read data from the stream?
a. getdta()
b. getresponse()
c. getstream()
d. getrawrequest()
Q. Which of these method of httpd class is used to get report on each hit to HTTPserver?
a. log()
b. logentry()
c. loghttpd()
d. logresponse()
Q. Which of these method is used to find a URL from the cache of httpd?
a. findfromcache()
b. findfromcache()
c. servefromcache()
d. getfromcache()
Q. Which of these variables stores the number of hits that are successfully servedout of cache?
a. hits
b. hitstocache
c. hits_to_cache
d. hits.to.cache
Q. Which of these method of httpd class is used to write UrlCacheEntry object intolocal disk?
a. writediskcache()
b. writetodisk()
c. writecache()
d. writediskentry()
Q. Which of these is an instance variable of class httpd?
a. port
b. cache
c. log
d. all of the mentioned
Q. Which of these is an instance variable of httpd that is a Hashtable?
a. port
b. cache
c. log
d. stopflag
Q. Which of these exception is thrown by URL class’s constructors?
a. urlnotfound
b. urlsourcenotfound
c. malformedurlexception
d. urlnotfoundexception
Q. Which of these methods is used to know host of an URL?
a. host()
b. gethost()
c. gethost()
d. gethost()
Q. Which of these methods is used to know the full URL of an URL object?
a. fullhost()
b. gethost()
c. externalform()
d. toexternalform()
Q. Which of these class is used to access actual bits or content information of aURL?
a. url
b. urldecoder
c. urlconnection
d. all of the mentioned
Q. Which object of HttpSession can be used to view and manipulate informationabout a session?
a. session identifier
b. creation time
c. last accessed time
d. all mentioned above
Q. Which of these ways used to communicate from an applet to servlet?
a. rmi communication
b. http communication
c. socket communication
d. all mentioned above