Webcam Chat QuickBooks Advice international calling cards international phone cards
JavaBeat Java Books Certifications Certifications Kits Articles Tutorials Tips QNA Book Store Interview Questions SCJP 1.5 SCJP 1.6 SCWCD 5.0 SCBCD 5.0 SCEA SCJA Feeds
300 Mock Questions on SCWCD 5.0 - JUST Rs.300 or 10 USD
Send us mail to sales@javabeat.net
more details
Do you have paypal account? Click Here to pay now and get the questions.

SCWCD 5.0 Mock Questions - 3

1. Regarding the processing of a BodyTag handler, in which of the following cases a BodyContent object will be "pushed" into the pageContext?

Select 1 correct option.
A.If the doStartTag() returns EVAL_BODY_INCLUDE
B.If the doStartTag() returns EVAL_BODY_BUFFERED
C.If the doStartTag() returns SKIP_BODY
D.If the doStartTag() DOES NOT return SKIP_BODY
E.A BodyContent object it is always created and pushed no matter what doStartTag() returns

2.Which of the following apply to Transfer Object design pattern?

Select 2 correct options.
A.It increases complexity by increasing the number of remote interfaces.
B. It increases network performance by introducing one coarse grained remote call for multiple finer grained network calls
C.It reduces network traffic by introducing one coarse grained remote call for multiple finer grained network calls
D.It increase server throughput by utilizing the CPU better
E.It increases design overhead due to versioning issues

3.Which of the following deployment descriptor snippets would you use to declare the use of a tag library?


1.

<tag-lib>

 <uri>http://abc.net/ourlib.tld</uri>

 <location>/WEB-INF/ourlib.tld</location>

</tag-lib>



2.

<taglib>

 <uri>http://abc.net/ourlib.tld</uri>

 <location>/WEB-INF/ourlib.tld</location>

</taglib>



3.

<taglib>

 <taglib-uri>http://abc.net/ourlib.tld</taglib-uri>

 <taglib-location>/WEB-INF/ourlib.tld</taglib-location>

</taglib>



4.

<taglib>

 <tagliburi>http://abc.net/ourlib.tld</uri>

 <tagliblocation>/WEB-INF/ourlib.tld</location>

</taglib>



5.

<taglibmap>

 <uri>http://abc.net/ourlib.tld</uri>

 <location>/WEB-INF/ourlib.tld</location>

</taglibmap>
Select 1 correct option.
A.1
B.2
C.3
D.4
E.5

4.Which of the following design patterns is used to separate the task of writing the GUI screens and business logic?

Select 1 correct option.
A.View Logic
B.Front Controller
C.Model View Controller
D.Business View
E.Business Delegate

5. For this jsp code to compile and run which of the given options should be true? <jsp:useBean class="com.bookstore.Book" type="java.lang.Object" id="book" />

Select 1 correct option.
A.This statement is wrong as type attribute is invalid.
B.Book must have a public no args constructor
C.Book must have a public constructor but there is no requirement on arguments.
D.Book must have a public getInstance() method.
E.This statement will always throw an exception at runtime no matter what you do to Book class.

6.Your servlet may throw IOException while processing a request. You want to define an error page in your deployment descriptor so that whenever IOException is thrown, this page is serviced to the browser. Which of the following XML fragments correctly specify the mapping:


1.

  <error-page>

    <exception>java.io.IOException</exception>

    <location>/html/Test.html</location>

  </error-page>



2.

  <error-page>

    <exception-class>java.io.IOException</exception-class>

    <location>/html/Test.html</location>

  </error-page>



3.

  <error-page>

    <exception-type>java.io.IOException</exception-type>

    <page-location>/html/Test.html</page-location>

  </error-page>



4.

  <error-page>

    <exception-type>java.io.IOException</exception-type>

    <location>/Enthuse/html/Test.html</location>

  </error-page>



5.

  <exception>

    <exception-type>java.io.IOException</exception-type>

    <location>/Enthuse/html/Test.html</location>

  </exception>
Select 1 correct option.
A.1
B.2
C.3
D.4
E.5

7.Select the tag that comes directly under the <web-app> tag of a web.xml and that is used to specify a class whose object will be sent notifications when changes occur to the SevletContext?

Select 1 correct option.
A.servlet-context-listener
B.listener
C.context-listener-class
D.listener-class
E.context-listener

8.Consider the following JSP code (See exhibit).
What will it print for the very first request to this page as well as the web application that contains this page?


<html><body>

<%

    Integer count = (Integer) request.getSession(false).getAttribute("count");

    if(count != null )

    {

        out.println(count);

    }

    else request.getSession(false).setAttribute("count", new Integer(1));

%>

Hello!

</body></html>
Select 1 correct option.
A.It will print Hello!
B.It will print Hello and will set the count attribute in the session.
C.It will throw a NullPointerException at request time.
D.It will not compile.

9. The following line of code exists in the doGet method of Servlet:
String sid = request.getParameter("jsessionid");
Which of the options will retrieve the HttpSession associated with the request? (Assume that the session has already been created.)

Select 3 correct options.
A.HttpSession session = request.getSession();
B.HttpSession session = HttpSession.getSession(sid);
C.HttpSession session = request.getSession(sid);
D.HttpSession session = request.getSession(true);
E.HttpSession session = request.getSession(false);

SCWCD Mock Questions 3 - Answers


JavaBeat Website (2004-2011), India
javabeat | advertise | about us | contact | useful resources
Copyright (2004 - 2011), JavaBeat


Technology Blogs
Technology blogs Technology Blogs
blog log