Lets Crack Online Exam

IT Interview Exam Questions: JAVA 22 (IT Campus Placement)

Subject: JAVA 22

Part 22: List for questions and answers of JAVA


Q1. What are the mechanisms available in ServletContextListener interface?

a) contextInit(),contextService(),contextDestroyed()

b) contextInitialized((),contextDestroyed()

c) contextInitialized(),contextService(),contextDestroyed()

d) None of the above


Q2. A deployment descriptor describes

a) web component response settings

b) web component settings

c) web component request objects

d) All of the above


Q3. 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


Q4. The life cycle of a servlet is managed by

a) servlet context

b) servlet container

c) the supporting protocol (such as http or https)

d) all of the above


Q5. 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


Q6. 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


Q7. What is the limit of data to be passed from HTML when doGet() method is used?

a) 4K

b) 8K

c) 2K

d) 1K


Q8. 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


Q9. Which of the following are the session tracking techniques?

a) URL rewriting, using session object, using response object, using hidden fields

b) URL rewriting, using session object, using cookies, using hidden fields

c) URL rewriting, using servlet object, using response object, using cookies

d) URL rewriting, using request object, using response object, using session object


Q10. Which method is used to specify before any lines that uses the PrintWriter?

a) setPageType()

b) setContextType()

c) setContentType()

d) setResponseType()


Q11. Which of these package is used for remote method invocation?

a) java.applet

b) java.rmi

c) java.lang.rmi

d) java.lang.reflect


Q12. Which of these methods are member of Remote class?

a) checkIP()

b) addLocation()

c) AddServer()

d) None of the mentioned 


Q13. Which of these Exceptions is thrown by remote method?

a) RemoteException

b) InputOutputException

c) RemoteAccessException

d) RemoteInputOutputException


Q14. Which of these class is used for creating a client for a server-client operations?

a) serverClientjava





Q15. Which of these package is used for all the text related modifications?

a) java.text

b) java.awt

c) java.lang.text

d) java.text.mofify


Q16. Which of these is wildcard symbol?

a) ?

b) !

c) %

d) &


Q17. What is use of wildcards?

a) It is used in cases when type being operated upon is not known

b) It is used to make code more readable

c) It is used to access members of super class

d) It is used for type argument of generic method


Q18. Which of these keywords is used to upper bound a wildcard?

a) stop

b) bound

c) extends

d) implements


Q19. Which of these is an correct way making a list that is upper bounded by class Number?

a) List

b) List

c) List(?extends Number)

d) List(?UpperBounds Number)


Q20. Which of the following keywords are used for lower bounding a wild card?

a) extends

b) super

c) class

d) lower 


Part 22: List for questions and answers of JAVA


Q1. Answer: b


Q2. Answer: b


Q3. Answer: d


Q4. Answer: b


Q5. Answer: a


Q6. Answer: a


Q7. Answer: c


Q8. Answer: d


Q9. Answer: b


Q10. Answer: c


Q11. Answer: b


Q12. Answer: d


Q13. Answer: a


Q14. Answer: c


Q15. Answer: a


Q16. Answer: a


Q17. Answer: a


Q18. Answer: c


Q19. Answer: a


Q20. Answer: b