Java Web, COBOL, and JCL Programming Quiz

A mixed quiz covering Java web development (JSP, servlets, deployment descriptors), COBOL programming syntax, and JCL mainframe job control language concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which of the following files is the correct name and location of deployment descriptor of a web application. Assume that the web application is rooted at \doc-root. Select the one correct answer

  1. \doc-root\dd.xml
  2. \doc-root\web.xml
  3. \doc-root\WEB-INF\web.xml
  4. \doc-root\WEB_INF\dd.xml
Question 2 Multiple Choice (Multiple Answers)

Which element of the servlet element in the deployment descriptor is used to specify the parameters for the ServletConfig object. Select the one correct answer.

  1. servlet-config
  2. init-param
  3. load-on-startup
  4. filter
Question 3 Multiple Choice (Single Answer)

What the JES will do?

  1. Checks for errors
  2. Schedules the job
  3. Manages the output processing of the job.
  4. All the above
  5. None of the above
Question 4 Multiple Choice (Multiple Answers)

Which of these is true about deployment descriptors. Select the one correct answer.

  1. The order of elements in deployment descriptor is not important. The elements can follow any order.
  2. The elements of deployment descriptor are case insensitive.
  3. The servlet-mapping element, if defined, must be included within the servlet element.
  4. The web-app element must include the servlet element.
Question 5 Multiple Choice (Single Answer)

Which one denotes the end of the JOB?

  1. //
  2. //*
  3. /*
  4. END
  5. NONE
Question 6 Multiple Choice (Multiple Answers)

The exception-type element specifies an exception type and is used to handle exceptions generated from a servlet. Which element of the deployment descriptor includes the exception-type as a sub-element. Select the one correct answer.

  1. error-page
  2. servlet
  3. exception
  4. error-handling
Question 7 Multiple Choice (Single Answer)

What is the Normal DISP position for temporary files?

  1. OLD
  2. PASS
  3. MOD
  4. SHR
Question 8 Multiple Choice (Multiple Answers)

Which of these is a correct fragment within the web-app element of deployment descriptor. Select the one correct answer. d

  1. <exception> <exception-type> mypackage.MyException</exception-type> <location> /error.jsp</location> </exception>
  2. <error-page> <exception-type> mypackage.MyException</exception-type> <location> /error.jsp</location> </error-page>
  3. <error-page> <exception> mypackage.MyException </exception-type> <location> /error.jsp </location> </error-page>
  4. <error-page> <exception-type> mypackage.MyException</exception-type> </error-page>
Question 9 Multiple Choice (Multiple Answers)

Which element of the deployment descriptor of a web application includes the welcome-file-list element as a subelement. Select the one correct answer.

  1. web-app
  2. welcome-file
  3. servlet
  4. file-list
Question 10 Multiple Choice (Multiple Answers)

Which of these are the correct fragment within the web-app element of deployment descriptor. Select the two correct answer.

  1. <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page>
  2. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-code> <location>/error.jsp</location> </error-page>
  3. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-code> </error-page>
  4. <error-page> <exception-type>mypackage.MyException</exception-type> <location>/error.jsp</location> </error-page>
Question 11 Multiple Choice (Multiple Answers)

Which of these is a correct example of specifying a listener element resented by MyClass class. Assume myServlet element is defined correctly. Select the one correct answer.

  1. <listener>MyClass</listener>
  2. <listener> <listener-class>MyClass</listener-class></listener>
  3. <listener> <listener-name>aListener</listener-name> <listener-class>MyClass</listener-class> </listener>
  4. <listener> <servlet-name>myServlet</servlet-name> <listener-class>MyClass</listener-class> </listener>
Question 12 Multiple Choice (Single Answer)

Continuation of the previous line should begin in the column

  1. 3
  2. Anywhere between 5 to 17
  3. Anywhere between 4 to 16
  4. Anywhere between 1 to 17
  5. No constraints
Question 13 Multiple Choice (Multiple Answers)

The root of the deployment descriptor is named as

  1. web
  2. web-app
  3. name
  4. display-name
Question 14 Multiple Choice (Multiple Answers)

With in a context-param element of deployment descriptor, which of the following element is required?

  1. param-name
  2. name
  3. init-param
  4. servlet-name
Question 15 Multiple Choice (Single Answer)

If the condition in the COND parameter satisfies what will happen?

  1. Step will not execute
  2. Step will abend
  3. Step will execute
  4. S0C7
Question 16 Multiple Choice (Multiple Answers)

What gets printed when the following expression is evaluated? Select the one correct answer. ${(1==2) ? 4 : 5}

  1. 1
  2. 2
  3. 4
  4. 5
Question 17 Multiple Choice (Multiple Answers)

What gets printed when the following expression is evaluated? Select the one correct answer. ${4 div 5}

  1. 0
  2. 0.8
  3. 1
  4. -1
Question 18 Multiple Choice (Multiple Answers)

What gets printed when the following expression is evaluated? Select the one correct answer. ${12 % 4}

  1. 0
  2. 3
  3. 8
  4. 16
Question 19 Multiple Choice (Single Answer)

What is program used to compile the COBOL program?

  1. IGYWCL
  2. IEWL
  3. IEBCOMPILE
  4. IGYCRCTL
Question 20 Multiple Choice (Multiple Answers)

What is the effect of executing the following JSP statement, assuming a class with name Employee exists in classes package. <%@ page import = "classes.Employee" %> <jsp:useBean id="employee" class="classes.Employee" scope="session"/> <jsp:setProperty name="employee" property="*"/>

  1. The code does not compile as there is no property attribute of setProperty tag.
  2. The code does not compile as property attribute cannot take * as a value.
  3. The code sets value of all properties of employee bean to "*".
  4. The code sets the values of all properties of employee bean to matrching parameters in request object.