1. The __________tier processes HTTP protocol, scripting tasks, performs calculations, and provides access to data.
Correct : A. Client
2. _________ are used to identify a user who returns to a Website.
Correct : A. Cookies
3. Which one of the following objects is passed to a Java Bean when one of its properties is
set via a JSP action?
Correct : C. Servlet Response
4. Struts framework is based on
Correct : A. Servlet.JSP and Java
5. Action Servlet, Request Processor and Action classes are the components of
Correct : B. Model
6. Which of the following delegates the request handling to the Request Processor instance?
Correct : B. Action class
7. How many instances can be created per application module by the Request Processor class?
Correct : C. One
8. An instance of Action is invoked by
Correct : A. ActionServlet
9. What declarations are required for every Java application?
Correct : A. A class and the main( ) method declarations.
10. What is a compilation unit?
Correct : B. Java source code file
11. In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true?
Correct : B. It must be named Test.java
12. What are identifiers and what is naming convention?
Correct : C. Identifiers are used for class names, method names and variable names.
13. What is the return type of program’s main( ) method?
Correct : C. Void
14. What is the value of a[3] as the result of the following array declaration?
Correct : D. 4
15. Which of the following are primitive types?
Correct : A. byte
16. What is the range of the char type?
Correct : D. 0 to 215-1
17. What are primitive data types?
Correct : A. byte, short, int, long
18. What are default values of different primitive types?
Correct : A. int - 0
19. How do we change the values of the elements of the array?
Correct : B. The array subscript expression can be used to change the values of the elements of the array.
20. Which of the following features are common to both Java & C++?
Correct : D. All of above
21. Which of the following statements accurately describe the use of access modifiers within
a class definition?
Correct : D. All of above
22. Which of the following statements can be used to describe a public method?
Correct : C. All of above
23. Which of the following statements correctly describes the relation between an object and the instance variable it stores?
Correct : D. All of above
24. What are the functions of the dot(.) operator?
Correct : D. All of above
25. When may a constructor be called without specifying arguments?
Correct : C. When there are no constructors for the class
26. When might your program wish to run the garbage collecter?
Correct : D. All of above
27. Which method is used to specify before any lines that uses the PrintWriter?
Correct : C. setContentType()
28. Servlet mapping defines
Correct : A. an association between a URL pattern and a servlet
29. The getSession() method with ‘true’ as its parameter [ getSession(true)] it will return the appropriate session object when
Correct : D. the session is existing
30. Dynamic interception of requests and responses to transform the information is done by
Correct : D. servlet filter
31. The method forward (request,response) will
Correct : A. return back to the same method from where the forward was invoked
32. What's the difference between servlets and applets? 1. Servlets executes on Servers, where as Applets executes on Browser 2. Servlets have no GUI, where as an Applet has GUI 3. Servlets creates static web pages, where as Applets creates dynamic web pages 4. Servlets can handle only a single request, where as Applet can handle multiple requests
Correct : B. 1,2 are correct
33. Which of the following are the session tracking techniques?
Correct : B. URL rewriting, using session object, using cookies, using hidden fields
34. The getSession() method with ‘true’ as its parameter [ getSession(true) ] it will return the appropriate session object when
Correct : D. the session is existing
35. RequestDispatcher object is used
Correct : A. to include other resources
36. The include() method of RequestDispatcher
Correct : B. includes resource of file like servlet, jsp or html
37. To get the servlet environment information
Correct : C. ServletContext object is used
38. The values of <servlet-name> and <servlet-class> in web.xml file
Correct : C. may be same
39. What is the limit of data to be passed from HTML when doGet() method is used?
Correct : C. 2K
40. In which advantage of servlet, Servlets are managed by JVM so no need to worry about memory leak, garbage collection etc.?
Correct : C. Robust
41. In the following statements identify the disadvantages of CGI?
Correct : D. All mentioned above
42. Servlet technology is used to create web application?
Correct : A. True
43. In HTTP Request Which Asks for the loopback of the request message, for testing or troubleshooting?
Correct : D. TRACE
44. In HTTP Request method Get request is secured because data is exposed in URL bar?
Correct : B. False
45. In the HTTP Request method which is non-idempotent?
Correct : B. POST
46. Give the examples of Application Server from the following?
Correct : D. Both B & C
47. Abbreviate the term MIME?
Correct : B. Multipurpose internet Mail Extension
48. Which packages represent interfaces and classes for servlet API?
Correct : C. Both A & B
49. The web container maintains the life cycle of a servlet instance,give the lifecycle of a servlet?
Correct : D. All mentioned above
50. What are the contents of web module?
Correct : A. JSP files
51. Which of the following are examples of JSP directive? Select the two correct answers.
Correct : A. include
52. A JSP page uses the java.util.ArrayList class many times. Instead of referring the class by its complete package name each time, we want to just use ArrayList. Which attribute of page directive must be specified to achieve this? Select the one correct answer.
Correct : B. import
53. A JSP page needs to generate an XML file. Which attribute of page directive may be used to specify that the JSP page is generating an XML file?
Correct : A. contentType
54. JSP pages have access to implicit objects that are exposed automatically. Name the implicit object that is of type HttpSession.
Correct : A. session
55. JSP pages have access to implicit objects that are exposed automatically. One such object that is available is request. The request object is an instance of which class?
Correct : D. HttpServletRequest
56. What is the limitation of creating ActionServlet instances per web application?
Correct : A. Two
57. ActionServlet, RequestProcessor and Action classes are the components of
Correct : D. Controller
58. Which of the java bean tags is used to show the bean value on the web page?
Correct : D. < bean:write>
59. Which of the following are server side programming languages? 1.HTML 2.JavaScript 3.JSP 4.Sevlets
Correct : C. 3,4
60. What JSP is basically used today?
Correct : B. To make GUI
61. What is the purpose of <noscript> tag in Java Script?
Correct : B. Enclose text to be displayed by non –JavaScript browsers.
62. Java Script entities start with ___________and end with _____________
Correct : D. Ampersand, semicolon.
63. Which of the following is a server-side Java Script object?
Correct : B. File
64. Which of the following is a client-side Java Script object?
Correct : C. FileUpload
65. Which of the following is the correct way for writing Java Script array?
Correct : C. var salaries = new Array(39438, 39839,83729)
66. Which of the following syntax is correct to refer an external script called “formValidation.js”?
Correct : D. <script src = “formValidation.js”>
67. What is the alternate name for Java script?
Correct : D. ECMAScript
68. What type of image map could be used with Java Script?
Correct : A. Client-side image maps
69. Which of the following are capable of Java Script functions?
Correct : C. Accepting parameters
70. Which of the following is not a valid JavaScript variable name?
Correct : A. 2java
71. What java wrapper type is created when a JavaScript object is sent to Java?
Correct : D. JSObject
72. Which of the following is correct to write “Hello World ” on the web page?
Correct : C. document.write(“Hello World”)
73. How does Java Script store dates in objects of Date type?
Correct : C. The number of milliseconds since January 1st, 1970
74. Which attribute needs to be changed to make elements invisible?
Correct : A. Visibility
75. Which machine actually executed the Java Script?
Correct : B. The machine which is running a web server.
76. Which attribute is used to hold the Java Script Version?
Correct : C. LANGUAGE
77. JavaScript RegExp Object has modifier 'i' to __________
Correct : B. Perform case-insensitive matching
78. How many ServletContext objects are available for an entire web application?
Correct : D. Only one
79. Which of the following delegates the request handling to the RequestProcessor instance?
Correct : A. ActionServlet
80. How many instances can be created per application module by the RequestProcessor class?
Correct : C. One
81. An instance of Action is invoked by
Correct : C. RequestProcessor
82. Application module selection is done by
Correct : B. ActionServlet
83. Which of the following methods is overridden by Action class?
Correct : A. execute()
84. Which of the following should always forwards or redirect to a resource (view) after completed?
Correct : D. Request Processor
85. Which of the following acts as a bridge between user-invoked URI and a business method?
Correct : B. Action class
86. Struts framework
Correct : A. should always decouple the application from a specific model implementation
87. Which of the following tags in struts-config.xml file defines the availability of necessary Struts JSP custom tag libraries?
Correct : C. < taglib>
88. Which can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc. in JSP?
Correct : D. Vs.JavaScript
89. Which attribute specifies a JSP page that should process any exceptions thrown but not
caught in the current page?
Correct : B. The IsErrorPage Attribute
90. What technique is used for the authentication mechanism in the servlet specification?
Correct : A. Role Based Authentication
91. In JSP Action tags which tags are used for bean development?
Correct : D. All mentioned above
92. Which two interfaces does the javax.servlet.jsp package have?
Correct : D. Both A & B
93. Which of the following is an advantage of the statement – Separation of business logic from JSP?
Correct : A. Custom Tags in JSP
94. JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you can
do with Java servlets.
Correct : A. True
95. How many jsp implicit objects are there and these objects are created by the web
container that are available to all the jsp pages?
Correct : B. 9
96. JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI)
Correct : A. True
97. Which action tags are used in JSP for developing web application with Java Bean?
Correct : D. Both B & C
98. Which statement correctly identifies the goals of the designers of the EJB architecture?
Correct : B. The EJB architecture is the standard component architecture for building distributed business applications in the Java programming language. (*)
99. Which statement about life-cycle callback methods is correct?
Correct : B. Life-cycle callback methods can have public, private, protected, or packagelevel access. (*)
100. Which of the following types of Enterprise Java Bean will be most likely to be difficult to port from one App Server to another?
Correct : D. CMP (Container Managed Persistence) Entity Bean