Enterprise Java MCQs with Answers Set 3

Enterprise Java Questions and Answers Set 3


Set 1           Set 2           Set 3

Questions 21 to 30


21. Which method of the servlet is/are called several times in its life?  

(a) init()
(b) doPost() 
(c) destroy()
(d) Both (a) and (b) above
(e) Both (a) and (c) above.

22. Which EJB uses EJB-QL for query operations?            

(a) BMP Entity Bean 
(b) CMP Entity Bean
(c) Session Bean
(d) Message-Driven Bean
(e) MCP Entity Bean.

23. Which object is used to forward the request processing from one servlet to another?    

(a) ServeltContext
(b) ServletConfig
(c) RequestDispatcher
(d) ResponseDispatcher
(e) ResponseRedirect.

24. Which is not a valid scope for Java bean in JSP?       

(a) Page
(b) Session
(c) Request
(d) Application
(e) Global.

25. Which of the following allows substitution of code to occur at the translation time in a JSP page?                                 

(a) <jsp:include> Tag
(b) <@ include> directive
(c) <@ page > directive
(d) Declaration block
(e) None of the above.

26. Which of the following property of Java Bean represents a single value?     

(a) Simple property 
(b) Boolean property 
(c) Indexed property
(d) Both (a) and (b) above
(e) Both (b) and (c) above.

27. Which of the following is used to redirect the response from a servlet to a JSP page? 

(a) response.sendRedirect() 
(b) request.sendRedirect() 
(c) request.forward()
(d) response.forward() 
(e) request.dispatch().

28. Which of the following is true for Java Bean?    

(a) It can not be a GUI component
(b) It never implements serializable interface
(c) It has zero-argument constructor
(d) It is a distributed component
(e) It has a non zero argument constructor.

29. Which of the following is not true for <jsp:useBean> tag in JSP page?    

(a) Locates a bean instance
(b) Stores object reference of the bean in a variable
(c) Creates an instance if fails to locate the bean instance
(d) Does not execute the body tag if any
(e) All the above.

30. Which of the following are not an implicit object in JSP?      

I. Request. 
II. Session. 
III. Vector. 
IV. In.

(a) Both (I) and (II) above
(b) Both (II) and (III) above 
(c) Both (I) and (III) above 
(d) Both (II) and (IV) above 
(e) Both (III) and (IV) above.

Answers And Explanation 


           Ans                               Explanation

21.         B       dopost() method of the servlet is called several times in its life.

22.         B       cmp entity bean uses ejb-ql for query operations.

23.         C       Request Dispatcher is used to forward the request processing from one servlet 
                        to another.

24.         E       Global is not a valid scope for java bean in Jsp.

25.         B       <@ include> directive allows substitution of code to occur at the translation 
                        time in a JSP page

26.         D       simple property and bolean property represents a single value.


27.         A       response.sendRedirect() is used to redirect the response from a servlet to a 
                        JSP page.

28.         C       java bean has a zero-argument constructor

29.         D       jsp:use bean tag is not used to execute the body of tag if any.

30.         E       vector and in are not implicit objects.



4 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. Java Beans Interview Questions and Answers
    http://allinterviewquestionsandanswerspdf.blogspot.in/2016/06/top-57-java-beans-interview-questions.html

    ReplyDelete