CS506-Web Design
And Development
Update MCQ’S Final Term
Rizwan Manzoor
@vutopperrm Vu Topper RM
d
cc
For More Help Contact What’s app 03224021365
Question No:1 (Marks:1) Vu-Topper RM
Which of the following methods of HTTPServletResponse returns the
enumeration of all available header names that are contained in the
request.
A. getMethod()
B. getRequestURL()
C. getHeaderNames()
D. getProtocol()
Question No:2 (Marks:1) Vu-Topper RM
What does getHeaderName("User-Agent") return if the "User-Agent"
header exists and its value is "Mozilla/5.0"?
A. null
B. Mozilla/5.0
C. An empty string
D. true
Question No:3 (Marks:1) Vu-Topper RM
Which parameter does getHeaderName() method of
HTTPServletResponse accept?
A. A double
B. A String
C. A boolean
D. An integer
Question No:4 (Marks:1) Vu-Topper RM
What is a cookie in the context of web browsing?
A. A type of browser plugin
B. A small piece of data stored on the user's device by websites
C. A security feature for preventing malware
D. A small piece of cake served by websites
For More Help Contact What’s app 03224021365
Question No:5 (Marks:1) Vu-Topper RM
To redirect to an HTML page named index.html located at the root of the
web application, what should be the argument to sendRedirect()?
A. sendRedirect("webapp/index.html")
B. sendRedirect("index.html")
C. sendRedirect("WEB-INF/index.html")
D. sendRedirect("contextPath/index.html")
Question No:6 (Marks:1) Vu-Topper RM
What is the purpose of getter and setter methods in a JavaBean?
A. Getters and setters define the constructor parameters of a
JavaBean.
B. Getters are used to retrieve data, and setters are used to
modify data.
C. Getters and setters are not required in JavaBeans.
D. Getters and setters are used for internal calculations within the
JavaBean
Question No:7 (Marks:1) Vu-Topper RM
What does the method getHeaderName() of HTTPServletResponse
return if no header exists with the specified name?
A. false
B. null
C. undefined
D. An empty string
Question No:8 (Marks:1) Vu-Topper RM
What are the requirements for a class to be considered a JavaBean?
A. It must implement the java.beans.Bean interface.
B. There are no specific requirements for a class to be a JavaBean.
C. It must have a default constructor and follow specific naming
conventions.
D. It must be a subclass of the java.beans.JavaBean class.
For More Help Contact What’s app 03224021365
Question No:9 (Marks:1) Vu-Topper RM
What does request.getCookies() return in Java servlets?
A. A single Cookie object representing all cookies sent by the client.
B. An array of Cookie objects representing cookies sent by the
client in the request.
C. The expiration time of cookies sent by the client.
D. The number of cookies sent by the client.
Question No:10 (Marks:1) Vu-Topper RM
What is session tracking in web applications?
A. Tracking user location on the website
B. Monitoring server performance
C. Maintaining stateful information about user interactions
D. Recording user demographics
Question No:11 (Marks:1) Vu-Topper RM
How to add a Cookie object to a HttpServletResponse in Java servlets?
A. Using response.sendCookie(cookie);
B. Using response.setCookie(cookie);
C. Using response.addCookie(cookie);
D. Using response.createCookie(cookie);
Question No:12 (Marks:1) Vu-Topper RM
How can a JavaBean be made serializable?
A. JavaBeans cannot be made serializable.
B. By annotating the class with @Serializable.
C. By implementing the java.io.Serializable interface.
D. By extending the java.beans.SerializableBean class.
Question No:13 (Marks:1) Vu-Topper RM
Which design principle do JavaBeans adhere to?
A. Polymorphism
B. Abstraction
For More Help Contact What’s app 03224021365
C. Encapsulation
D. Inheritance
Question No:14 (Marks:1) Vu-Topper RM
Is it true "server considers each request independent from other even if
the requests are made by the same client"?
Yes
No
Question No:15 (Marks:1) Vu-Topper RM
What does J2EE stand for?
A. Java 2 Extended Edition
B. Java 2 Essential Edition
C. Java 2 Experiment Edition
D. Java 2 Enterprise Edition
Question No:16 (Marks:1) Vu-Topper RM
TELNET works on _______ port.
A. 21
B. 23 Page 193
C. 80
D. 84
Question No:17 (Marks:1) Vu-Topper RM
How many simultaneous connections can be opened using TCP and
UDP ports?
A. 64
B. 64k
C. 128
D. 128k Page 193
For More Help Contact What’s app 03224021365
Question No:18 (Marks:1) Vu-Topper RM
If "MyServlet" is placed in "myapp" folder, then you can access
"MyServlet" by writing _______________ url in browser.
A. http://localhost:8080/webapps/myapp/MyServlet
B. http://localhost:8080/myapp/servlets/MyServlet
C. http://localhost:8080/myapp/MyServlet
D. http://localhost:8080/webapps/myapp/servlets/MyServlet
Question No:19 (Marks:1) Vu-Topper RM
Which of the following methods is called only once during the life cycle
of an Applet?
A. start()
B. stop()
C. paint()
D. init()
Question No:20 (Marks:1) Vu-Topper RM
Which of the following commands is used to invoke an Applet named
Test from command line interpreter?
A. appletviewer Test.html
B. appletrunner Test.java
C. appletviewer Test.java
D. appletrunner Test.html
Question No:21 (Marks:1) Vu-Topper RM
In Java, Serializable Interface can be found under _________ package.
A. java.sql
B. java.util
C. java.io
D. java.net
Question No:22 (Marks:1) Vu-Topper RM
Timer class constructor requires time in _______________.
For More Help Contact What’s app 03224021365
A. Seconds
B. Nano seconds
C. Micro seconds
D. Mili seconds Page 179
Question No:23 (Marks:1) Vu-Topper RM
Which method is called first when an applet is loaded?
A. stop()
B. destroy()
C. start()
D. init()
Question No:24 (Marks:1) Vu-Topper RM
Which keyword is used in Java to mark fields that should not be
serialized?
A. final
B. static
C. transient
D. volatile
Question No:25 (Marks:1) Vu-Topper RM
What is the purpose of the transient keyword in Java serialization?
A. It indicates that a variable should not be serialized.
B. It indicates that a class cannot be serialized.
C. It indicates that an object cannot be serialized.
D. It indicates that a method cannot be serialized.
Question No:26 (Marks:1) Vu-Topper RM
Since Java is portable and servlets is a Java based technology, therefore
they are generally portable across_________________ .
A. Client computers
B. Mobile devices
C. Web servers
For More Help Contact What’s app 03224021365
D. Desktop applications
Question No:27 (Marks:1) Vu-Topper RM
To compile a servlet (e.g. MyServlet.java) ____________ command is
used in command prompt.
A. javac
B. java-c
C. java c
D. java
Question No:28 (Marks:1) Vu-Topper RM
Which method of ServerSocket class is used to accept incoming client
connections in Java?
A. accept()
B. connect()
C. bind()
D. open()
Question No:29 (Marks:1) Vu-Topper RM
If you want the timer to fire only the first time and then stop, invoke
______________.
A. setOnce(true)
B. setOnce(false)
C. setRepeats(true)
D. setRepeats(false) Google
Question No:30 (Marks:1) Vu-Topper RM
To serialize an object in Java, we typically use
_____________________ .
A. ClassInputStream
B. ObjectInputStream
C. ObjectOutputStream
D. ClassOutputStream
For More Help Contact What’s app 03224021365
Question No:31 (Marks:1) Vu-Topper RM
Which method is called when an applet is about to be removed from
memory?
A. destroy()
B. stop()
C. start()
D. init()
Question No:32 (Marks:1) Vu-Topper RM
Which of the following methods of Graphics object is used to draw
rectangle?
A. drawReactangle(10,10,20,20);
B. drawRect(10,10,20,20);
C. DrawRect(10,10,20,20);
D. DrawReactangle(10,10,20,20);
Question No:33 (Marks:1) Vu-Topper RM
Which Java package is used for socket programming?
A. java.util
B. java.sql
C. java.net
D. java.lang
Question No:34 (Marks:1) Vu-Topper RM
Which of the following is true about Apache Tomcat?
A. It implements Java Servlet and Java Server Pages
specifications.
B. It only supports HTTP protocol.
C. It can only run on Linux servers.
D. It is primarily used for running Python applications.
For More Help Contact What’s app 03224021365
Question No:35 (Marks:1) Vu-Topper RM
A port is a __________________ to which processes can listen for
connections request.
A. Local Address
B. Client Address
C. Server Address
D. Transport Address Page 193
Question No:36 (Marks:1) Vu-Topper RM
Which interface must a class implement to be serializable in Java?
A. SerializableObject
B. Externalizable
C. Serialize
D. Serializable
Question No:37 (Marks:1) Vu-Topper RM
During deserialization in Java, which casting is required to recreate the
original object type?
A. Down-casting
B. Right-casting
C. Up-casting
D. Left-casting
Question No:38 (Marks:1) Vu-Topper RM
How many ports are available for UDP socket?
A. 64k
B. 128
C. 64
D. 128k
Question No:39 (Marks:1) Vu-Topper RM
Servlets are commonly used to:
A. Style web pages with CSS
For More Help Contact What’s app 03224021365
B. Store data in a database
C. Execute client-side scripts
D. Generate dynamic web content
Question No:40 (Marks:1) Vu-Topper RM
By means of Page Directive, a JSP can be given the responsibility of an
Error page.
True Page 389
False
Question No:41 (Marks:1) Vu-Topper RM
Which of the following is the correct format of writing a page directive
in JSP?
A. <%@ taglib {attribute=”val”} %> Page 379
B. <%$ taglib {attribute=”val”} %>
C. <%! taglib {attribute=”val”} %>
D. <%# taglib {attribute=”val”} %>
Question No:42 (Marks:1) Vu-Topper RM
Tag Library Descriptor (.tld) file is a simple text base document.
False Page 378
True
Question No:43 (Marks:1) Vu-Topper RM
JSP Stands for ____________ .
A. Java Server Page Google
B. Java Servlet Pages
C. Java Server Program
D. Java Standard Protocol
Question No:44 (Marks:1) Vu-Topper RM
Which of the following approach is also called page-with-bean
approach.
For More Help Contact What’s app 03224021365
A. MVC Model1 Page 404
B. MVC Model2
C. MVC Model3
D. Page-Centric approach
Question No:45 (Marks:1) Vu-Topper RM
Which of the following is the main idea behind partitioning a web
application into layers?
A. Increase Decoupling
B. Reduce Coupling.
C. Increase Coupling
D. Reduce Decoupling
Question No:46 (Marks:1) Vu-Topper RM
Which of the following architecture introduces a controller?
A. MVC Model 3
B. MVC Model 2 Page 404
C. MVC Model 1
D. MVC Model 4
Question No:47 (Marks:1) Vu-Topper RM
Which file extension is used for JSP files?
A. .js
B. .java
C. .jsp Google
D. .html
Question No:48 (Marks:1) Vu-Topper RM
Which of the following is true about tag with attributes in JSP?
A. All of the given options Page 377
B. It has attribute within tag
C. It has no body enclosed
D. It has start and end of tag
For More Help Contact What’s app 03224021365
Question No:49 (Marks:1) Vu-Topper RM
The correct way to define a JSP forward action element is:
A. <jsp:forward page = “one.jsp” /> Page 373
B. <jsp:forward page # “one.jsp” />
C. <jsp:forward page $ “one.jsp” />
D. <jsp:forward page @ “one.jsp” />
Question No:50 (Marks:1) Vu-Topper RM
"application" is a object of:
A. ServletContext
B. HttpSession
C. ServletConfig
D. Both b and c
Question No:51 (Marks:1) Vu-Topper RM
Is it true that Enterprise Applications need to support multiple types of
users with multiple types of interfaces?
Yes
NO
Question No:52 (Marks:1) Vu-Topper RM
A separate controller is a part of which of the following approache?
A. MVC Model 3
B. MVC Model 2 Page 404
C. MVC Model 1
D. Page-Centric approach
Question No:53 (Marks:1) Vu-Topper RM
What is a JavaBean?
A. A type of coffee available in Java.
B. A framework for developing web applications in Java.
C. A built-in data type in Java for storing numerical values.
D. A lightweight Java class that encapsulates data and behavior.
For More Help Contact What’s app 03224021365
Question No:54 (Marks:1) Vu-Topper RM
Which of the following choices is the best choice as a controller in MVC
Model Architecture?
A. JavaScript
B. Java
C. Servlet Page 421
D. JSP
Question No:55 (Marks:1) Vu-Topper RM
Normally web applications are partitioned into _______ logical layers.
A. one
B. two
C. fore
D. three Page 243
Question No:56 (Marks:1) Vu-Topper RM
What is the purpose of JSP?
A. To define the structure and styling of web pages.
B. To manage server configurations and deployments.
C. To handle client-side scripting in web applications.
D. To generate dynamic web content using Java code.
Question No:57 (Marks:1) Vu-Topper RM
Which keyword is used to declare a package in Java?
A. Include
B. import
C. Package Google
D. Namespace
Question No:58 (Marks:1) Vu-Topper RM
Which of the following information is required by the JSP container?
A. Tag name
B. JSP version
For More Help Contact What’s app 03224021365
C. Tag library version
D. All of the given options Page 379
Question No:59 (Marks:1) Vu-Topper RM
In context of JSP custom tags, is it true that a "Tag with Attributes" does
NOT have a body?
True Page 377
False
Question No:60 (Marks:1) Vu-Topper RM
In page-with-Bean (MVC Model1) approach all the business logic goes
into .......
A. JSPs
B. Servlets
C. JavaScript
D. JavaBeans Page 404
Question No:61 (Marks:1) Vu-Topper RM
The method "getAttribute(String)" of HttpSession class extracts
______________ stored value from a session object.
A. Subsequently
B. First
C. Previously Page 321
D. Currently
Question No:62 (Marks:1) Vu-Topper RM
The correct way to call an error page in JSP is:
%@page ... isErrorPage = "error.jsp"%
Question No:63 (Marks:1) Vu-Topper RM
A Java class that follows certain design conventions is
called____________.
A. ServletBean
For More Help Contact What’s app 03224021365
B. SwingBean
C. JavaBean Page 353
D. JSPBean
Question No:64 (Marks:1) Vu-Topper RM
In MVC Model1 architecture, the JSP page alone is responsible for
processing the incoming request and replying back to the client.
True Page 403
False
Question No:65 (Marks:1) Vu-Topper RM
The correct way to declare a page as an error page in JSP is:
A. <%@page … SetErrorPage = “true”%>
B. <%@page … errorPage = “true”%>
C. <%@page … isErrorPage = “true”%> Page 389
D. <%@page … getErrorPage = “true”%>
Question No:66 (Marks:1) Vu-Topper RM
In context of JSP custom tags, a simple tag also has a body.
False Page 376
True
Question No:67 (Marks:1) Vu-Topper RM
In JSP, ____________ is an implicit object, which belongs to
ServletConfig class and represents the JSP configuration options.
A. Config Page 344
B. Session
C. Application
D. PageContext
Question No:68 (Marks:1) Vu-Topper RM
_________________ is NOT the type of HTTP request.
A. Delete
For More Help Contact What’s app 03224021365
B. Update Page 262
C. Post
D. Get
Question No:69 (Marks:1) Vu-Topper RM
Timers are constructed by specifying both a delay parameter and a/an
_________ Listener.
A. Key
B. Mouse
C. Action Page 179
D. Window
Question No:70 (Marks:1) Vu-Topper RM
CGI (Common Gateway Interface) was widely used for generating
________ .
A. Static web content
B. Mobile application
C. Desktop application
D. Dynamic web content Page 245
Question No:71 (Marks:1) Vu-Topper RM
FTP (File Transmission Protocol) works on _________ port.
A. 21 Page 193
B. 23
C. 80
D. 84
Question No:72 (Marks:1) Vu-Topper RM
In the context of Java Thread, sleep() method throws __________
exception.
A. Interrupted Page 233
B. Input output
C. File not found
For More Help Contact What’s app 03224021365
D. Index out of bound
Question No:73 (Marks:1) Vu-Topper RM
By implementing this interface, a class declares that it is willing to be
________ by automatic serialization machinery.
A. Read Page 203
B. Decode
C. Checked
D. Destroyed
Question No:74 (Marks:1) Vu-Topper RM
Which of the following range of response code signify error by server?
A. 200-299
B. 300-399
C. 500-599 Page 232
D. 400-499
Question No:75 (Marks:1) Vu-Topper RM
Which of the following methods takes the place of constructor in an
Applet?
A. run()
B. start()
C. init() Page 184
D. main()
Question No:76 (Marks:1) Vu-Topper RM
How many ports are available for TCP socket?
A. 64
B. 128
C. 64k Page 193
D. 128k
For More Help Contact What’s app 03224021365
Question No:77 (Marks:1) Vu-Topper RM
int i = (int)( Math.random() * 5 ); // will generate random numbers
between__________ .
A. 0 & 5
B. 1 & 4
C. 1 & 5
D. 0 & 4 Page 187
Question No:78 (Marks:1) Vu-Topper RM
Which of the following is NOT a part of HTTP request?
A. Header fields
B. URI
C. Request method
D. Status code Page 232
Question No:79 (Marks:1) Vu-Topper RM
Which of the following problem occurs with lower priority threads?
A. Process death
B. Starvation Page 218
C. Race condition
D. Average waiting time
Question No:80 (Marks:1) Vu-Topper RM
Which of the following method is called only once during life cycle of
Servlet?
A. init() Page 184
B. service()
C. destroy()
D. start()
Question No:81 (Marks:1) Vu-Topper RM
Which of the following approach can used to create threads in java?
A. Inheritance Page 212
For More Help Contact What’s app 03224021365
B. Abstraction
C. Composition
D. Polymorphism
Question No:82 (Marks:1) Vu-Topper RM
Choose correct integer value for predefined Thread Priority
“Thread.MAX_PRIORITY” in java.
A. 1
B. 5
C. 10 Page 216
D. 7
Question No:83 (Marks:1) Vu-Topper RM
An applet can be defined as:
A. A small program written in java and included in an HTML
page. Page 181
B. A small program written in JSP and included in an HTML page.
C. A small program written in servlet and included in an HTML page.
D. A small program written in JSF and included in an HTML page.
Question No:84 (Marks:1) Vu-Topper RM
Choose correct line of code to start a thread 't' in Java.
A. T-start()
B. t=start()
C. t->start()
D. t.start() Page 213
Question No:85 (Marks:1) Vu-Topper RM
Which of the following method needs to override while handling threads
injava?
A. start()
B. runnable()
C. run() Page 212
For More Help Contact What’s app 03224021365
D. init()
Question No:86 (Marks:1) Vu-Topper RM
JAVA_Home indicates the _____________ of JDK.
A. Bin folder
B. Webapps folder
C. Web page
D. Root directory Page 248
Question No:87 (Marks:1) Vu-Topper RM
If attribute is "name" and value is "ahmad" then the GET request will be
____________________ .
A. http://www.gmail.com/register?name=ahmad Page 262
B. http://www.gmail.com/register#name=ahmad
C. http://www.gmail.com/register&name=ahmad
D. http://www.gmail.com/register?name.ahmad
Question No:88 (Marks:1) Vu-Topper RM
Servlets are java technology’s answer to ________ programming.
A. CGI Page 245
B. Perl
C. C++
D. C
Question No:89 (Marks:1) Vu-Topper RM
Which of the following range of response code indicates that request
was successful?
A. 100-199
B. 200-299 Page 234
C. 300-399
D. 400-499
For More Help Contact What’s app 03224021365
Question No:90 (Marks:1) Vu-Topper RM
Which of the following variable value will not be set during the
installation and configuration of Apache Tomcat Server?
A. CLASSPATH
B. CATALINA_HOME
C. JDK_HOME Page 247
D. JAVA_HOME
Question No:91 (Marks:1) Vu-Topper RM
Which of the following method allows any other thread of same priority
toexecute?
A. Yield() Page 224
B. Sleep()
C. Wait()
D. Notify()
Question No:92 (Marks:1) Vu-Topper RM
Socket is a ___________ commnunication channel between hosts.
A. tri-directional
B. uni-directional
C. multi-directional
D. bi-directional Page 193
Question No:93 (Marks:1) Vu-Topper RM
In _____________ state, thread is assigned a processor to run.
A. Ready
B. New
C. Running Page 226
D. Dead
Question No:94 (Marks:1) Vu-Topper RM
Which of the following methods is invoked by the AWT package to
support paint and repaint operations?
For More Help Contact What’s app 03224021365
A. paint()
B. draw()
C. redraw()
D. repaint() Page 174
Question No:95 (Marks:1) Vu-Topper RM
How many methods are there in the Serializable Interface?
A. Zero Page 203
B. One
C. Two
D. Three
Question No:96 (Marks:1) Vu-Topper RM
Real world business objects are represented in ____________..
A. Data layer Page 243
B. Presentation
C. Business layer
D. Application layer
Question No:97 (Marks:1) Vu-Topper RM
Which of the following is the correct syntax to make a PersonInfo class
into a Serializable class?
A. Public class PersonInfo extends Serializable{/*class body*/}
B. Public class PersonInfo includes Serializable{/*class body*/}
C. Public class PersonInfo responds Serializable{/*class body*/}
D. Public class PersonInfo Implements Serializable{/*class
body*/} Page 204
Question No:98 (Marks:1) Vu-Topper RM
Servlet mapping is defined in ________
A. JSP
B. html
C. servlet
For More Help Contact What’s app 03224021365
D. web.xml Page 265
Question No:99 (Marks:1) Vu-Topper RM
Which of the following commands is used to invoke an Applet from
command line interpreter?
A. viewer htmlfile
B. applet htmlfile
C. appletviewer javafile
D. appletviewer htmlfile Page 183
Question No:100 (Marks:1) Vu-Topper RM
Which of the given will clear all the previous painting?
A. super.paint
B. super.redraw()
C. super.repaint()
D. super.paintComponent() Page 175
Question No:101 (Marks:1) Vu-Topper RM
"Ready State" means a thread is in _____________ .
A. New state Page 226
B. Waiting state
C. Ready state
D. Dead state
Question No:102 (Marks:1) Vu-Topper RM
In web.xml, root tag _____________ represents web application.
A. Webapp
B. <web-app> Page 255
C. <webapp>
D. <web.app>
Question No:103 (Marks:1) Vu-Topper RM
How many methods are there in the Serializable Interface?
For More Help Contact What’s app 03224021365
A. Java.io Google
B. java.sql
C. Java.util
D. None of above
Question No:104 (Marks:1) Vu-Topper RM
Which of the following is not a servlet related package?
A. javax.servlet.Servlet
B. javax.servlet
C. javax.servlet.http
D. javax.servlet.Svit Page 260
Question No:105 (Marks:1) Vu-Topper RM
Inside <servlet-mapping> tag, first write _____________ of the servlet
using ______________ tag in web.xml.
A. url, <servlet-url>
B. name, <servlet-name> Page 265
C. url, <url-pattern>
D. class, <servlet-class>
Question No:106 (Marks:1) Vu-Topper RM
Which of the following is NOT true about HTTP?
A. HTTP is a request response communication model
B. HTTP has no built-in state management between successive
requests
C. HTTP maintains user session between successive requests
Page 231
D. HTTP is a stateless protocol
Question No:107 (Marks:1) Vu-Topper RM
Engine of the servlet is ______________ method.
A. service() Page 268
B. load()
For More Help Contact What’s app 03224021365
C. init()
D. Create()
Question No:108 (Marks:1) Vu-Topper RM
Choose the correct statement by which thread 't' causes currently
executing thread to block until thread 't' finishes its run() method.
A. t.join() Page 229
B. t.wait()
C. t.start()
D. t.sleep()
Question No:109 (Marks:1) Vu-Topper RM
Which of the following statement is correct to assign maximum priority
to thread “t2”?
A. t2.setPriority(Thread.PRIORITY_MiX)
B. t2.setPriority(Thread.PRIORITY_MAX)
C. .t2.setPriority(Thread.MAX_PRIORITY)
D. .t2.setPriority(Thread.MIN_PRIORITY)
Question No:110 (Marks:1) Vu-Topper RM
Assume that we do not want to serialize phoneNum attribute of
PersonInfo class, this can be done by:
A. client String phoneNum;
B. server String phoneNum;
C. serializable String phoneNum;
D. transient String phoneNum; Page 208
Question No:111 (Marks:1) Vu-Topper RM
Choose correct integer value for predefined Thread Priority
"Thread.MIN_PRIORITY" in Java.
A. 1
B. 7
C. 5
For More Help Contact What’s app 03224021365
D. 10
Question No:112 (Marks:1) Vu-Topper RM
Which of the following is NOT a web technoloy of Java?
A. Servlet
B. JSP
C. ASP
D. JSF
Question No:113 (Marks:1) Vu-Topper RM
Which of the following syntax is used to create a server socket?
A. ServerSocket ss = new ServerSocket(“ServerName”);
B. ServerSocket ss = new ServerSocket(“ServerPort”); Page 196
C. ServerSocket ss = new ServerSocket(“ServerPort. ServerName”);
D. ServerSocket ss = new ServerSocket(“ServerName. ServerPort”);
Question No:114 (Marks:1) Vu-Topper RM
In the context of HTTP Response Code, the values in the 200s signify
that _________________.
A. Request was successful Page 231
B. Request was not successful
C. Error by server
D. Error by client
Question No:115 (Marks:1) Vu-Topper RM
The webapps folder is the _______ Tomcat directory that contains all the
web applications deployed on the server.
A. Least-level
B. Top-level Page 258
C. Mid-level
D. Bottom-level
For More Help Contact What’s app 03224021365
Question No:116 (Marks:1) Vu-Topper RM
Choose correct line of code to inherit a worker class from thread class in
java.
A. Public class worker new thread()
B. Public class worker inherit thread()
C. Public class worker implement thread()
D. Public class worker extends thread() Page 214
Question No:117 (Marks:1) Vu-Topper RM
Thread sleep () method causes the currently executing thread to wait for
the time in _________.
A. Nanoseconds
B. Microseconds
C. Milliseconds Page 223 ok
D. Zeptoseconds
Question No:118 (Marks:1) Vu-Topper RM
setColor() is a method of ________ object.
A. Image
B. JPanel
C. JFrame
D. Graphics Page 172
Question No:119 (Marks:1) Vu-Topper RM
Which of the following methods of an Applet is called every time when
page is minimized?
A. init()
B. stop() Google
C. start()
D. destroy()
Question No:120 (Marks:1) Vu-Topper RM
Which of the following is not the part of http response?
For More Help Contact What’s app 03224021365
A. URL Google
B. Header files
C. Status code
D. Result Code
Question No:121 (Marks:1) Vu-Topper RM
In the context of HTTP Response Code, the values in the 400s indicate
that _________________.
A. error by client Page 235
B. Resource is available
C. Error by server
D. Resource is not available
Question No:122 (Marks:1) Vu-Topper RM
http response code 403 indicates that-----------
A. access to the requested resource was successful
B. resource has been destroyed
C. access to the requested resource has been denied Page 231
D. resource can be accessed after one hour
Question No:123 (Marks:1) Vu-Topper RM
When a thread is in "New state" during its life cycle, it is
_________________.
A. In ready queue
B. Just created Page 226
C. Being assigned a processor to run
D. Ready to run
Question No:124 (Marks:1) Vu-Topper RM
Which of the following is not the stage of servlet lifecycle?
A. Wait Page 267
B. Service
C. Destroy
For More Help Contact What’s app 03224021365
D. Initialize
Question No:125 (Marks:1) Vu-Topper RM
Request and response of servlet are handles at____stage
A. Destroy
B. Initialize
C. Failure Page 258
D. Service
Question No:126 (Marks:1) Vu-Topper RM
At servlet service stage, webserver invokes __________ method.
A. servletServices()
B. services() Page 270
C. serviceSvlt()
D. svltServices()
Question No:127 (Marks:1) Vu-Topper RM
HTTP response code 401 indicates that ______________ .
A. Request resource is available
B. Request requires http authentication Page 231
C. Error by server
D. Request resource is not available
Question No:128 (Marks:1) Vu-Topper RM
In GET HTTP Request type, attribute-value pair is attached after
____________ with requested URL.
A. @
B. #
C. ? Page 253
D. .
For More Help Contact What’s app 03224021365
Question No:129 (Marks:1) Vu-Topper RM
Which of the following interface needs to implement while creating
threads?
A. Windowslistener
B. Runnable Page 212
C. Actionlistener
D. Serializable
Question No:130 (Marks:1) Vu-Topper RM
Which of the following is true about simple tag in JSP?
A. All of the given options Page 377
B. It has no body is specified in tag
C. It has start and end of tag
D. It has no attribute
Question No:131 (Marks:1) Vu-Topper RM
To compile a servlet(e.gmyservlet.java)------ command is used in
command prompt
A. Java-c
B. Java
C. Java.c
D. Javac Page 256
Question No:132 (Marks:1) Vu-Topper RM
The ____________ method is used, when one thread wants to wait for
another thread's run method to complete its execution.
A. Join() Page 227
B. Wait()
C. Sleep()
D. Yield()
For More Help Contact What’s app 03224021365
Question No:133 (Marks:1) Vu-Topper RM
In the context of servlet mapping in web.xml, URL is provided in
___________ tag.
A. <url-source>
B. <url-destination>
C. <url-address>
D. <url-pattern> Page 255
Question No:134 (Marks:1) Vu-Topper RM
Entire JSP page gets translated into a servlet .
A. Once Page 323
B. Every time when it is accessed
C. Every time when the page is refreshed
D. Every time when the browser is restarted
Question No:135 (Marks:1) Vu-Topper RM
A bean class have a zero argument constructor.
A. Can
B. Can’t
C. Must Page 356
D. Shouldn’t
Question No:136 (Marks:1) Vu-Topper RM
Layers represent the _ view of application.
A. Physical
B. Logical Page 435
C. External
D. None of these
Question No:137 (Marks:1) Vu-Topper RM
The dot operator in Expression Language is typically used for accessing
the of an object.
A. Properties Page 458
For More Help Contact What’s app 03224021365
B. Elements
C. Values
D. Attributes
Question No:138 (Marks:1) Vu-Topper RM
Initialization parameters of a servlet are defined in file.
A. html
B. JSP
C. web.xml Page 275
D. servlet
Question No:139 (Marks:1) Vu-Topper RM
Which of the following is NOT appropriate for Page-centric approach?
A. The maintenance of the application becomes a nightmare.
B. A lot of code is also get duplicated.
C. Scaling of such kind of application is easy. Page 397
D. The code becomes a mixture of presentation, business and data
accesslogic.
Question No:140 (Marks:1) Vu-Topper RM
Which of the following 'statement' object is used for executing
precompiled SQL statements?
A. Statement
B. PreparedStatement Page 147
C. CallableStatement
D. None of the given options
Question No:141 (Marks:1) Vu-Topper RM
UDDI stands for
A. Universal Description, Discovery & Integration (UDDI)
Page490
B. Universal Data, Discovery & Integration (UDDI)
C. Universal Data, Database & Integration (UDDI)
For More Help Contact What’s app 03224021365
D. None of the given options
Question No:142 (Marks:1) Vu-Topper RM
DataBaseMetaData object can be derived from object.
A. ResultSet
B. Connection Page 165
C. Statement
D. ResultSetMetaData
Question No:143 (Marks:1) Vu-Topper RM
DSN stands for .
A. Domain System Name
B. Data Source Name Page 166
C. Database Name
D. System name
Question No:144 (Marks:1) Vu-Topper RM
There is/are form(s) of response redirection.
A. 1
B. 2 Page 270
C. 3
D. 4
Question No:145 (Marks:1) Vu-Topper RM
Expression is a code fragment which returns .
A. Integer
B. String Page 326
C. Depends on the expression
D. Nothing
Question No:146 (Marks:1) Vu-Topper RM
A servlet _____________ during its initialize stage.
A. unloads resource/s
For More Help Contact What’s app 03224021365
B. accept request/s
C. Loads resources/s Page 2
D. forwards request/s
Question No:147 (Marks:1) Vu-Topper RM
CREATE TABLE, DROP TABLE, and ALTER TABLE etc are --.
A. DML statements
B. DDL statements Page 144
C. DCL statements
D. None of given options
Question No:148 (Marks:1) Vu-Topper RM
Which of the following approach can use to create thread in java?
A. Abstraction
B. Inheritance Page 212
C. Composition
D. Polymorphism
Question No:149 (Marks:1) Vu-Topper RM
Request and response of servlet are handled at _________ stage.
A. destroy
B. initialize
C. failure
D. service Page267
Question No:150 (Marks:1) Vu-Topper RM
Which of the following feature is not available in java Pointers?
A. Operator overloading
B. Global variables
C. All of given options
Question No:151 (Marks:1) Vu-Topper RM
HTTP response code 100s indicates ________________ .
For More Help Contact What’s app 03224021365
A. to continue without request
B. do not continue with any request
C. to continue with complete request
D. to continue with partial request Page 234
Question No:152 (Marks:1) Vu-Topper RM
Which of the following is NOT web technology of Java?
A. ASP Page 244
B. JSF
C. JSP
D. Servlet
Question No:153 (Marks:1) Vu-Topper RM
If “MyServelet”is placed in “myapp” folder, then you can access
“MyServlet” by writing :
A. http://localhost8080/myapp/MyServlet
B. http://localhost8080/myapp/servelets/MyServlet
C. http://localhost8080/webapps/myapp/servlets/MyServlet
D. http://localhost8080/webapps/myapp/MyServlet
Page 265
Question No:154 (Marks:1) Vu-Topper RM
HTTP response code 404 indicates that ________________ .
A. requested resource is not available Page 235
B. request requires HTTP authentication
C. requested resource is available
D. error by server
Question No:155 (Marks:1) Vu-Topper RM
The newly created thread can be moved to "Ready State" by calling
_______________ method.
A. start() Page 228
B. wait()
For More Help Contact What’s app 03224021365
C. sleep()
D. yield()
Question No:156 (Marks:1) Vu-Topper RM
At servlet initialization stage, webserver invokes __________ method.
A. ServletInit()
B. init() Page 267
C. initServelt()
D. initialize()
Question No:157 (Marks:1) Vu-Topper RM
Which of the following Java/J2EE technology can be used for client
presentation layer?
A. Applets Page 430
B. JavaBean
C. Java Server Faces(JSF)
D. Java Server Pages(JSP)
Question No:158 (Marks:1) Vu-Topper RM
The correct way to define a JSP include action element is:
A. <jsp:include page = "one.jsp"/> Page 373
B. <jsp:include page @ "one.jsp"/>
C. <jsp:include page # "one.jsp"/>
D. <jsp:include page $ "one.jsp"/>
Question No:159 (Marks:1) Vu-Topper RM
Which of the given options is NOT true for Page-centric approach?
A. The code becomes a mixture of presentation, business and data
access logic
B. A lot of code is also get duplicated
C. Scaling of such kind of application is easy Page 404
D. The maintenance of the application becomes a nightmare
For More Help Contact What’s app 03224021365
Question No:160 (Marks:1) Vu-Topper RM
Which of the following tag/s can be constructed in JSP?
A. Tag with Attributes
B. Simple Tag
C. All of the given options Page 376
D. Tag with Body
Question No:161 (Marks:1) Vu-Topper RM
How does URL rewriting work in Java web applications?
A. Appending session ID as a query parameter to the URL.
B. Modifying the URL in the client's browser using JavaScript.
C. Replacing URL paths with user-friendly aliases.
D. Storing session ID in cookies.
Question No:162 (Marks:1) Vu-Topper RM
Which of the following is the correct format of writing a taglib directive
in JSP?
A. <%@ taglib {attribute=”val”} %>
B. <%! taglib {attribute=”val”} %>
C. <%# taglib {attribute=”val”} %>
D. <%$ taglib {attribute=”val”} %>
Question No:163 (Marks:1) Vu-Topper RM
The business layer in Java applications is responsible for:
A. Managing the application's database connectivity
B. Storing and retrieving data from persistent storage
C. Handling user interface rendering and event handling
D. Implementing business logic and processing rules
Question No:164 (Marks:1) Vu-Topper RM
Which of the following is the correct format of writing an include
directive in JSP?
A. <%$ include {attribute=”val”} %>
For More Help Contact What’s app 03224021365
B. <%# include {attribute=”val”} %>
C. <%@ include {attribute=”val”} %>
D. <%! include {attribute=”val”} %>
Question No:165 (Marks:1) Vu-Topper RM
HTML comments are ____________ in browser and JSP comments are
________________ in browser.
A. shown, shown
B. shown, hidden
C. hidden, shown
D. hidden, hidden
Question No:166 (Marks:1) Vu-Topper RM
Which of the following is responsible for handling user interactions and
displaying data in a Java application?
A. Presentation layer
B. Persistence layer
C. Business layer
D. Data layer
Question No:167 (Marks:1) Vu-Topper RM
HttpServletResponse provides ________ methods to perform encoding
in java.
A. One
B. Two Page 317
C. Four
D. Three
Question No:168 (Marks:1) Vu-Topper RM
What is a package in Java?
A. A group of classes with similar functionality.
B. A folder or directory that organizes related classes and
interfaces.
For More Help Contact What’s app 03224021365
C. A collection of methods for a specific task.
D. A set of variables used in a program.
Question No:169 (Marks:1) Vu-Topper RM
Which method is used to encode a URL for URL rewriting in Java
Servlets?
A. session.encodeURL(String url)
B. response.encodeURL(String url)
C. request.encodeURL(String url)
D. context.encodeURL(String url)
Question No:170 (Marks:1) Vu-Topper RM
Which session tracking technique appends the session ID as a query
parameter in the URL?
A. Cookies
B. Database storage
C. URL rewriting
D. Hidden form fields
Question No:171 (Marks:1) Vu-Topper RM
Which directive is used to import Java classes in JSP?
A. <%-- --%>
B. <scriptlet>
C. <include>
D. <import>
Question No:172 (Marks:1) Vu-Topper RM
How does JSP differ from servlets?
A. JSP is written in Java, while servlets are written in JavaScript.
B. JSP is executed on the server and generates dynamic content,
while servlets handle requests and responses.
C. JSP allows for a mixture of HTML and Java code, while servlets
are purely Java code.
For More Help Contact What’s app 03224021365
D. JSP is used for client-side interactions, while servlets handle
server-side operations.
Question No:173 (Marks:1) Vu-Topper RM
How do you set the maximum age of a Cookie object in Java?
A. myCookie.setAge(3600);
B. myCookie.setMaxAge(3600);
C. myCookie.setMaxAgeInSeconds(3600);
D. myCookie.setExpiration(3600);
Question No:174 (Marks:1) Vu-Topper RM
The data layer in Java applications is responsible for:
A. Presenting data to the user in a user-friendly format
B. Storing and retrieving data from persistent storage
C. Handling user input validation and error handling
D. Handling user authentication and authorization
Question No:175 (Marks:1) Vu-Topper RM
The method "cookie.setMaxAge(12)" indicates that the cookie will
expire after ___________ .
A. 12 Days
B. 12 Seconds
C. 12 Hours
D. 12 Minutes
Question No:176 (Marks:1) Vu-Topper RM
Which of the following is the correct method of HttpServletResponse to
perform encoding in java?
A. String encodeRedirect(String URL)
B. String encodeMineURL(String URL)
C. String RedirectURL(String URL)
D. String encodeRedirectURL(String URL)
For More Help Contact What’s app 03224021365
Question No:177 (Marks:1) Vu-Topper RM
What is the correct syntax to create a Cookie object in Java?
A. Cookie myCookie = createCookie("name", "value");
B. Cookie myCookie = new Cookie("name", "value");
C. Cookie myCookie = Cookie.createCookie();
D. Cookie myCookie = new Cookie();
Question No:178 (Marks:1) Vu-Topper RM
In which technique does the server store a unique session identifier on
the client's browser?
A. Cookies
B. URL rewriting
C. Database storage
D. Hidden form fields
Question No:179 (Marks:1) Vu-Topper RM
What is URL rewriting in Java web applications?
A. Rewriting URLs to make them more user-friendly.
B. Encoding special characters in URLs for secure communication.
C. Modifying the URL of a web page for search engine optimization.
D. Manipulating URLs to maintain session state in web
applications.
Question No:180 (Marks:1) Vu-Topper RM
Which of the following techniques is not used for session tracking in
web applications?
A. Serialization
B. URL Rewriting
C. Cookies
D. Hidden form fields
For More Help Contact What’s app 03224021365
Question No:181 (Marks:1) Vu-Topper RM
setContentLength() method of HTTPServletResponse sets the length of
content by taking _____________ parameter as length.
A. float
B. character
C. integer
D. string
Question No:182 (Marks:1) Vu-Topper RM
Each web application has ______________ servlet context/s.
A. 0
B. 2
C. 1
D. 3
Question No:183 (Marks:1) Vu-Topper RM
getProtocol() method of HTTPServletRequest is used to get the
_________ and ___________ of protocol.
A. id, version
B. name, version
C. name, class
D. id, class
Question No:184 (Marks:1) Vu-Topper RM
The __________________ method actually processes the clients
request.
A. destroy()
B. init()
C. service()
D. yield()
For More Help Contact What’s app 03224021365
Question No:185 (Marks:1) Vu-Topper RM
Choose correct integer value for predefined Thread Priority
"Thread.NORM_PRIORITY" in Java.
A. 7
B. 1
C. 5
D. 10
Question No:186 (Marks:1) Vu-Topper RM
From the following packages which one is used to write the servlets?
A. java.util
B. javax
C. java
D. java.lang
Question No:187 (Marks:1) Vu-Topper RM
Resources could be shared among all servlets in _______________
application/s using _____________ .
A. same, Servlet object
B. different, Servlet object
C. Same, ServletContext object
D. different, ServletContext object
Question No:188 (Marks:1) Vu-Topper RM
Servlet context stores initialization parameters of ______________ .
A. one servlet
B. a java file
C. of entire web application
D. of all web applications in a server
Question No:189 (Marks:1) Vu-Topper RM
Which of the following object is used for sharing resources among
different servlets of same application?
For More Help Contact What’s app 03224021365
A. ServletConfig
B. ServletRequest
C. ServletResponse
D. Servlet Context
Question No:190 (Marks:1) Vu-Topper RM
Which of the following is not an HttpServletRequest method?
A. setAttribute(String, Object)
B. setProtocol() Page 294
C. getMethod()
D. getProtocol()
Question No:191 (Marks:1) Vu-Topper RM
Server spawns a new thread for each new request from the client by
calling servlet's ________________ method.
A. init()
B. yield()
C. spwan()
D. service()
Question No:192 (Marks:1) Vu-Topper RM
During different sessions, getServletContext() method provides
____________ ServletContext object/s to ____________ Servlets.
A. Different,Same
B. Same, Same
C. Same, Different
D. Different, Different
Question No:193 (Marks:1) Vu-Topper RM
Which of the following tag is used to define initialization parameters
value of a servlet?
A. <param-value></param-value>
B. <para-value></para-value>
For More Help Contact What’s app 03224021365
C. <initparam-value></initparam-value>
D. <parameter-value></parameter-value>
Question No:194 (Marks:1) Vu-Topper RM
In the context of Session Tracking, states are maintained by the mutual
cooperation of both client & __________.
A. Server Page 297
B. User
C. Browser
D. Customer
Question No:195 (Marks:1) Vu-Topper RM
Web.xml is a ___________
A. Java File
B. Configration File
C. Jar file
D. Servlet
Question No:196 (Marks:1) Vu-Topper RM
Servlets are used to
A. Create Graphics
B. Provide Dynamic Web Content which extant web service
C. Develop Applets
D. Create GUI
Question No:197 (Marks:1) Vu-Topper RM
Which of the following folder contains configuration file?
A. Classes
B. Lib
C. Bin
D. WEB-INF
For More Help Contact What’s app 03224021365
Question No:198 (Marks:1) Vu-Topper RM
addCookie() method of HTTPServletResponse takes ___________ as a
parameter and adds it to the cookie header.
A. cookie object
B. session id
C. ip address
D. MAC address
Question No:199 (Marks:1) Vu-Topper RM
In include type of request dispatcher, the first servlet which received
request is also responsible to __________ .
A. finish response
B. modify request
C. show exceptions
D. forward request
Question No:200 (Marks:1) Vu-Topper RM
Context attributes are shared among _____________ servlet/s of
___________ .
A. all, a web application
B. two, a web application
C. all, desktop applications
D. two, desktop applications
Question No:201 (Marks:1) Vu-Topper RM
3-layer architecture consists of Presentation Layer, _____________
Layer and Data Layer.
A. Application
B. Business
C. Server
D. Client
For More Help Contact What’s app 03224021365
HTTP works on port _________.
A. 23
B. 84
C. 21
D. 80
An applet is basically a/an _____________ that allows interaction with a
Java program.
A. Window
B. Panel
C. Frame
D. Label
The following code creates and starts a timer that fires an action event
once per ______.
Timer t = new Timer (1000, this);
t.start();
A. Minute
B. Day
C. Second
D. Hou
To deserialize an object in Java, we typically use
_____________________ .
A. ObjectOutputStream
B. ClassOutputStream
C. ObjectInputStream
D. ClassInputStream
In ResultSetMetaData methods, ____________ method returns the
suggested column label for printouts.
A. getColumnCount ()
B. getColumnName()
For More Help Contact What’s app 03224021365
C. getColumnType (int)
D. getColumnLabel()
In the context of Java Graphics; most of time, painting is done
automatically.
False
True
Which of the following statements is true regarding paintComponent()
method?
A. It tells any components contained by this component to paint
themselves.
B. It first performs custom painting and then paints the background.
C. It first paints the background and then performs custom
painting.
D. It tells the component to paint its border.
In order to include graphics in your Java program, it is mandatory to
extend from _________ class.
A. JFrame
B. JLabel
C. JPanel
D. JButton
Which of the following objects is passed as an argument to
paintComponent() method?
A. JPanel object
B. Image object
C. JFrame object
D. Graphics object
What is the purpose of the <servlet-mapping> tag in web.xml?
A. To define servlets with their class names.
For More Help Contact What’s app 03224021365
B. To set session configuration for servlets.
C. To configure servlet initialization parameters.
D. To specify the URL patterns that map to servlets
Where are cookies typically stored?
A. In the user's computer's RAM
B. On the website's server
C. In the website's HTML code
D. In a specific folder on the user's device
Question No:0_1 (Marks:01) Vu-Topper RM
Which of the following is not true regarding layers?
A. Easier reuse of code
B. Easier maintenance
C. Provide high coupling Page 427
D. Provide high cohesion
Question No:202 (Marks:1) Vu-Topper RM
From the following methods, which method cannot be overridden in the
JSP page
A. jspService()
B. jspDestroy()
C. jspInit()
D. None of these
Question No:203 (Marks:1) Vu-Topper RM
Unpack directory structure of J2EE web application is __________
A. Known as Web Archive file (WAR)
B. Used during development of web application
C. Used to deploy web application
D. None of the given options
For More Help Contact What’s app 03224021365
Question No:204 (Marks:1) Vu-Topper RM
The getSession() method of _________ returns HttpSession object.
A. HttpServletResponse
B. HttpServletRequest
C. ServletConfig
D. ServletContext
Question No:205 (Marks:1) Vu-Topper RM
Which of the following is NOT a standard method called as a part of the
JSP life cycle?
A. jspInit()
B. jspService()
C. jspService()
D. jspDestroy()
Question No:206 (Marks:1) Vu-Topper RM
AWT is also called ______________.
A. Light Weight Component
B. Medium Weight Component
C. Heavy Weight Component
D. None of the given options
Question No:207 (Marks:1) Vu-Topper RM
Based on functionality, the streams can be categorized as ________
A. Byte oriented stream and Node stream
B. Filter stream and Character oriented stream
C. Node stream and Filter stream
Question No:208 (Marks:1) Vu-Topper RM
Which of the following is not included in simple tag while creating JSP
custom tags?
A. Start of tag
B. End of tag
For More Help Contact What’s app 03224021365
C. Attributes
D. None of the given options
Question No:209 (Marks:1) Vu-Topper RM
MVC stands for _____________.
A. Model View Content
B. Model View Controller
C. Multi View Controller
D. Multi View Content
Question No:210 (Marks:1) Vu-Topper RM
In packages, we organize files into different directories according to
their ____________.
A. Functionality
B. Usability
C. Category
D. All of these
Question No:211 (Marks:1) Vu-Topper RM
Strings in java are represented as __________
A. Primitive data types
B. Reference data types
C. Native data types
D. Operators
Question No:212 (Marks:1) Vu-Topper RM
How many forms of redirect?
A. One
B. Two
C. Three
D. Four
For More Help Contact What’s app 03224021365
Question No:213 (Marks:1) Vu-Topper RM
CREATE, ALTER, DROP are _________ SQL statements.
A. DML
B. DDL
C. DCL
D. None of given
Question No:214 (Marks:1) Vu-Topper RM
Web server is a software which provides services to access _________.
A. Internet
B. Intranet
C. Extranet
D. All of the given
Question No:215 (Marks:1) Vu-Topper RM
From the following which one is not a built-in validator?
A. DoubleRangeValidator
B. LongRangeValidator
C. LengthValidator
D. StringValidator
Question No:216 (Marks:1) Vu-Topper RM
RPC stands for
A. Remote Personal Computer (RPC)
B. Remote Procedure Calls (RPC).
C. Remote Procedure Client (RPC)
D. None of these
Question No:217 (Marks:1) Vu-Topper RM
From the following which session tracking technique is used when new
session is started?
A. Cookies
B. URL Rewriting
For More Help Contact What’s app 03224021365
C. Both Cookies and URL Rewriting
D. None of These
Question No:218 (Marks:1) Vu-Topper RM
HTTP Session stores session information in
A. File System of client
B. File System of Server
C. A Cookie
D. A Session Object
Question No:219 (Marks:1) Vu-Topper RM
From the following which is not a basic function of web-based
application:
A. Presentation
B. Debugging
C. Business Logic
D. Data Management
Question No:220 (Marks:1) Vu-Topper RM
Overloading is _______ whereas overriding is _____
A. Run time binding, compile time binding
B. Late binding, compile time binding
C. Compile time binding, run time binding
D. Run time binding, late time binding
Question No:221 (Marks:1) Vu-Topper RM
From following methods; which method is not a part of the JSP life
cycle
A. jspInit()
B. jspService()
C. jspService()
D. jspDestroy()
For More Help Contact What’s app 03224021365
Question No:222 (Marks:1) Vu-Topper RM
A top-level class without any modifier is accessible to any
A. class
B. any class within the same package
C. any class within the same file
D. any subclass of this class
Question No:223 (Marks:1) Vu-Topper RM
Java program code is compiled into form called
A. Machine code
B. native Code
C. Byte Code
D. Source Code
Question No:224 (Marks:1) Vu-Topper RM
What if the main method is declared as private?
A. The program does not compile
B. The program compiles but does not run
C. The program compiles and runs properly
D. The program throws an exception on compile time
Question No:225 (Marks:1) Vu-Topper RM
There are _________ types of exceptions in Java
A. 2
B. 3
C. 4
D. 5
Question No:226 (Marks:1) Vu-Topper RM
Which of the following is used for inheritance in java?
A. implements
B. extends
C. (colon)
For More Help Contact What’s app 03224021365
D. inherit
Question No:227 (Marks:1) Vu-Topper RM
A top level class may have only the following access modifier.
A. Package
B. Private
C. Protected
D. Public
Question No:228 (Marks:1) Vu-Topper RM
Which of the following package needs to be import while handling files?
A. java.util
B. java.io
C. java.awt
D. javax.swing
Question No:229 (Marks:1) Vu-Topper RM
Exceptions must be handled while handling files otherwise it may lead
to _____
A. Logical error
B. Syntax error
C. Run-time error
D. No error
Question No:230 (Marks:1) Vu-Topper RM
All the exceptions and errors in java are inherited from _____ class.
A. Exception
B. Error
C. Throwable
D. IOException
For More Help Contact What’s app 03224021365
Question No:231 (Marks:1) Vu-Topper RM
Which of the following exception belongs to a category of un-checked
exception?
A. IOException
B. Null Pointer exception
C. AWTException
D. ClassNotFoundException
Question No:232 (Marks:1) Vu-Topper RM
Which of the following belongs to a category of checked exception?
A. Null Pointer exception
B. IO Exception
C. Array index out of bounds
D. NumberFormatException
Question No:233 (Marks:1) Vu-Topper RM
The relationship between class and interface is called ________.
A. ' Is a ' relationship
B. ' Has a ' relationship
C. ' Responds to ' relationship
D. None of the given options
Question No:234 (Marks:1) Vu-Topper RM
An abstract class ---------------instantiated.
A. Cannot be
B. Can be
C. Must
D. None of these
Question No:235 (Marks:1) Vu-Topper RM
The classes which contain the word _____ are byte oriented streams.
A. Byte
B. Reader
For More Help Contact What’s app 03224021365
C. Writer
D. Stream
Question No:236 (Marks:1) Vu-Topper RM
Window frame and dialog use ________ as their default layout.
A. Border layout
B. Flow layout
C. GridBag layout
D. Grid layout
Question No:237 (Marks:1) Vu-Topper RM
Which of the following stream is a filter stream?
A. FileWriter
B. FileReader
C. BufferedReader
D. All of given options
Question No:238 (Marks:1) Vu-Topper RM
Which of the following command is used to run java program?
A. Java filename.java
B. Java filename
C. Javac filename.java
D. Javac filename
Question No:239 (Marks:1) Vu-Topper RM
==operator compares ____________ of strings whereas equals ()
method compares ______ of the string.
A. Value, Addresses
B. Address, Values
C. Size, Addresses
D. Addresses, Size
For More Help Contact What’s app 03224021365
Question No:240 (Marks:1) Vu-Topper RM
Which of the following feature provides the facility for multiple
inheritance?
A. Adapter Classes
B. Wrapper Classes
C. Interfaces
D. Collections
Question No:241 (Marks:1) Vu-Topper RM
The given line of code will result in
___________ system. Out. printing (5+9);
A. 59
B. 5+9
C. 14
D. syntax error
Question No:242 (Marks:1) Vu-Topper RM
Which of the following stream is a Node stream?
A. PrintWriter
B. FileWriter
C. BufferedReader
D. All of the given option
Question No:243 (Marks:1) Vu-Topper RM
To compare the value of two strings, _______ must be used.
A. =operator
B. ==operator
C. Equal () method
D. Compare () method
Question No:244 (Marks:1) Vu-Topper RM
Which of the following method is used to convert a string into an int
value?
For More Help Contact What’s app 03224021365
A. IntValue()
B. parselnt()
C. Parselnt ()
D. parselInteger()
Question No:245 (Marks:1) Vu-Topper RM
What will happen if we write static public void instead of public static
void?
A. Program does not compile
B. Program compiles but does not run
C. Program compiles and run successfully
D. Program throws an exception
Question No:246 (Marks:1) Vu-Topper RM
Static methods can only access __________
A. Instance variables
B. Instance methods
C. Static variables and methods
D. Both static and instance members
Question No:247 (Marks:1) Vu-Topper RM
HahMap takes key as a/an _________
A. Object
B. Array
C. Primitive value
D. Function
Question No:248 (Marks:1) Vu-Topper RM
Which of the following stream read/write data in the form of bytes?
A. FileReader
B. FileWriter
C. PrintWriter
D. FileInputStream
For More Help Contact What’s app 03224021365
Question No:249 (Marks:1) Vu-Topper RM
A variable declared as static in a class is a/an _________
A. Instance variable
B. Class variable
C. Const variable
D. Global variable
Question No:250 (Marks:1) Vu-Topper RM
What will happen if static modifier is removed from the signature of
main method?
A. The program does not compile
B. The program compiles and runs successfully
C. The program compiles but does not run
D. None of given options
Question No:251 (Marks:1) Vu-Topper RM
Which of the following syntax attaches an output stream to console?
A. FileWriterfw = new FileWriter(“output.txt”);
B. FileWriterfw = new FileWriter (FileDescriptor.out);
C. FileWriterfw = new FileWriter (FileDescriptor.in);
D. FileWriterfw = new FileWriter (File Descriptor );
Question No:252 (Marks:1) Vu-Topper RM
Which of the following Environment variable tells the system about the
root directory of TOMCAT?
A. Java HOME
B. CATALINA_HOME
C. CLASSPATH
D. PATH
For More Help Contact What’s app 03224021365
Question No:253 (Marks:1) Vu-Topper RM
From the following which ID is transmitted between the client and the
server
A. Session ID
B. Network ID
C. Server ID
D. None of these
Question No:254 (Marks:1) Vu-Topper RM
An event in java is represented as ________
A. Operator
B. Function
C. Object
D. Primitive data type
Question No:255 (Marks:1) Vu-Topper RM
Which of the following method is used to execute INSERT, UPDATE
and Delete SQL statements?
A. executeQuery(sql);
B. ExecuteQuery(sql);
C. executeUpdate(sql);
D. ExecuteUpdate(sql);
Question No:256 (Marks:1) Vu-Topper RM
Which of the following command is used to compile Java code?
A. java filename
B. javac filename.java
C. javac filename
D. java filename.java
Question No:257 (Marks:1) Vu-Topper RM
Exception handling code is written in _______
A. try
For More Help Contact What’s app 03224021365
B. finally
C. block
D. throws clause
Question No:258 (Marks:1) Vu-Topper RM
Witch of the following is a general-purpose container?
A. Frame
B. Dialog
C. Janel
D. Applet
Question No:259 (Marks:1) Vu-Topper RM
Which of the following object contains information specific to a servlet?
A. ServletConfig
B. ServletRequest
C. ServletContext
D. ServletResponse
Question No:260 (Marks:1) Vu-Topper RM
To destroy the session in Servlet we use?
A. session.destroy()
B. session.invalidate()
C. session.end()
D. session.Kill()
Question No:261 (Marks:1) Vu-Topper RM
From following which one is the object of JspWriter used to send output
to the client.
A. request
B. out
C. response
D. None of these
For More Help Contact What’s app 03224021365
Question No:262 (Marks:1) Vu-Topper RM
Moving session from one server to another in case of server failure is
known as
A. Session Migration
B. Session Tracking
C. Session Hijacking
D. None of these
Question No:263 (Marks:1) Vu-Topper RM
From the following which one is not a JSP directive?
A.page
B. include
C. taglib
D. out
Question No:264 (Marks:1) Vu-Topper RM
Client is referred as a
A. Computer user
B. Computer that a person is using for communication purpose
C. Person which carry out web surfing
D. None of these
Question No:265 (Marks:1) Vu-Topper RM
A cookie is a piece of ------- that a web server can store on a client’s hard
disk.
A. Number
B. Text
C. String
D. None of these
Question No:266 (Marks:1) Vu-Topper RM
In JSP Instance variables and method are declared through following tag
A. <%@ %>
For More Help Contact What’s app 03224021365
B. <%-- --%>
C. <%! %>
D. <%= %>
Question No:267 (Marks:1) Vu-Topper RM
To provide global control of JSP we use following tag
A. <%@ %>
B. <%-- -%>
C. <%! %>
D. <%= %>
Question No:268 (Marks:1) Vu-Topper RM
Hidden Forms Fields contain the information that is needed to send to
the
A. Client
B. Server
C. Both server and client
D. None of these
Question No:269 (Marks:1) Vu-Topper RM
Session Tracking is done through following techniques?
A. Cookies
B. Hidden fields
C. URL Rewriting
D. All the these
Question No:270 (Marks:1) Vu-Topper RM
JSP scripting elements is/are
A. Declarations
B. Scriptlets
C. expressions
D. All of these
For More Help Contact What’s app 03224021365
Question No:271 (Marks:1) Vu-Topper RM
From the following indicators; which is added in user session to know
the session time out?
A. Sessiontimeoutindicator
B. SessionTimeOutIndicator
C. SessionTimeoutIndicator
D. None of these
Question No:272 (Marks:1) Vu-Topper RM
HTTP is a ---------protocol.
A. Stateless
B. Connectionless
C. Connection oriented
D. None of these
Question No:273 (Marks:1) Vu-Topper RM
getId( ) returns the unique ID of
A. Current session
B. Previous session
C. None of these
D. Next session
Question No:274 (Marks:1) Vu-Topper RM
Which of the following is NOT true about JavaBean?
A. It should not have any public variable.
B. It must be serializable.
C. It must not have any zero argument constructor.
D. Private instances must be accessed via setters/getters.
Question No:275 (Marks:1) Vu-Topper RM
JSP ____________ action element is used to obtain a reference to an
existing JavaBean object.
A. useBean
For More Help Contact What’s app 03224021365
B. setProperty
C. getProperty
D. None of these
Question No:276 (Marks:1) Vu-Topper RM
From following tags, which one is the Special JSP tag?
A. <jsp: .…. />
B. <%! %>
C. <%= %>
D. <%@ %>
Question No:277 (Marks:1) Vu-Topper RM
What is the initial contact point for handling a web request in a Page-
Centric architecture?
A. JSP
B. JavaBean
C. servlet
D. HTML page
Question No:278 (Marks:1) Vu-Topper RM
“application” is a object of
A. ServletContext.
B. HttpSession
C. ServletConfig
D. None of these
Question No:279 (Marks:1) Vu-Topper RM
All -----------data is kept at the application server.
A. Dynamic
B. Static
C. Both dynamic and static
D. None of these
For More Help Contact What’s app 03224021365
Question No:280 (Marks:1) Vu-Topper RM
Which one is used to collect data when a user navigates between web
pages?
A. Session Tracking
B. User Tracking
C. None of these
D. Session Migration
Question No:281 (Marks:1) Vu-Topper RM
To define the error page in JSP we use following tag?
A. exception-type
B. error-type
C. error-page
D. exception-page
Question No:282 (Marks:1) Vu-Topper RM
From following which code can be used to create session object in the
Servlet:
A. HttpSession session = req.getSession(true);
B. HttpSession session = req.getSession(false);
C. HttpSession session = req.getSession(1);
D. None of these
Question No:283 (Marks:1) Vu-Topper RM
When JSP page compiled, it is translated into?
A. Applet
B. Application
C. Servlet
D. Web Browser
Question No:284 (Marks:1) Vu-Topper RM
Packages are the way to organize files into different -------------
For More Help Contact What’s app 03224021365
according to their functionality, usability as well as category they should
belong to.
A. Directories
B. Folders
C. Libraries
D. None of these
Question No:285 (Marks:1) Vu-Topper RM
setAttribute(String, Object) associates a ----------with a name.
A. None of these
B. Object
C. String
D. Value
Question No:286 (Marks:1) Vu-Topper RM
addCookies() method of HTTPServletResponse takes________ as a
parameter and adds it to the cookies header.
A. Cookies object
B. Ip address
C. AC address
D. Session id
Question No:287 (Marks:1) Vu-Topper RM
From the following which code can be used to create session object in
the Servlet
A. HttpSession session=req.getSession(true);
B. HttpSession session=req.getSession(false);
C. HttpSession session=req.getSession(1);
D. HttpSession session=req.setSession(1);
Question No:288 (Marks:1) Vu-Topper RM
Which of the following syntax used to attach an input stream to console?
A. FileReaderfr=new FileReader((input.txt))
For More Help Contact What’s app 03224021365
B. FileReaderfr=new FileRead(FileDescriptor.in);
C. FileReaderfr=new FileReader(FileDescriptor);
Question No:289 (Marks:1) Vu-Topper RM
javax.servlet.jsp.PageContext, is used to give a ---------point of access to
many of the page attributes.
Single
Multiple
Question No:290 (Marks:1) Vu-Topper RM
HTML form data can be processed by JSP
True
False
Question No:291 (Marks:1) Vu-Topper RM
Java provides an excellent solution to all the problems that occurred in
tracking a session.
True
False
Question No:292 (Marks:1) Vu-Topper RM
In JSP scripting elements, it is NOT necessary that every opening tag
also have a closing tag.
False Page 340
True
Question No:293 (Marks:1) Vu-Topper RM
Java + HTML = JSP
True
False
For More Help Contact What’s app 03224021365
Question No:294 (Marks:1) Vu-Topper RM
getrequest() method gets information from a client and postrequest()
method posts data to a client.
False
True
Question No:295 (Marks:1) Vu-Topper RM
sendRedirect() method of HTTPServletResponse redirects the user to
______________ .
Specific URL Page 295
Main class
Question No:296 (Marks:1) Vu-Topper RM
Packages are nothing more than the way we organize files into different
directories according to their functionality, usability as well as category
they should belong to.
False Page 329
True
Question No:297 (Marks:1) Vu-Topper RM
getParameters() method returns an array of strings containing the values
for a specified servlet parameter.
True
False
Question No:298 (Marks:1) Vu-Topper RM
In 3-layer architecture, we do NOT make any direct calls to database
from the presentation layer.
False Page 322
True
For More Help Contact What’s app 03224021365
Question No:299 (Marks:1) Vu-Topper RM
JSP is a text based document capable of returning either static or
dynamic content to a client’s browser.
True Page 334
False
Question No:300 (Marks:1) Vu-Topper RM
Presence of cookie indicates that the user is visiting this site for the first
time.
False Page 300
True
Question No:301 (Marks:1) Vu-Topper RM
Layers are isolated from each other to increase coupling between them.
False Page 322
True
Question No:302 (Marks:1) Vu-Topper RM
Cookies can be used for identifying a user during an e-commerce session
True
False
Question No:303 (Marks:1) Vu-Topper RM
The ___________ represent the state of component.
View
Model
Question No:304 (Marks:1) Vu-Topper RM
Interface of HttpServletResponse extends class Servlet Response
False
True
For More Help Contact What’s app 03224021365
Question No:305 (Marks:1) Vu-Topper RM
HttpServletResponse object is created when web server executes the
servlet. This object is passes to the servlet service method which passes
it to do Get () or doPost ().
True
False
Question No:306 (Marks:1) Vu-Topper RM
A collection can store ..........
Homogenous objects
Heterogeneous objects
Question No:307 (Marks:1) Vu-Topper RM
Which of the following is called ' pure abstract class ' ?
Wrapper class
Interface
Question No:308 (Marks:1) Vu-Topper RM
Is it possible to provide more than one main method within same class?
True
False
Question No:309 (Marks:1) Vu-Topper RM
There is NO equivalent tag for comments while writing JSP scripting
elements in XML.
True
False
Question No:310 (Marks:1) Vu-Topper RM
Which of the following is/are not correct about thread(s)?
Heavy weight
Light weight
For More Help Contact What’s app 03224021365
Question No:311 (Marks:1) Vu-Topper RM
Web applications maintain the state of a user’s actions against multiple
requests, because HTTP protocol is stateless.
True
False
Question No:312 (Marks:1) Vu-Topper RM
JSP directives are used to convey special processing information about
the page to JSP container.
True
False
Question No:313 (Marks:1) Vu-Topper RM
Interface can be implemented in JSP
True
False
Question No:314 (Marks:1) Vu-Topper RM
When a session object is invalidated, it can be again refreshed.
True
False
Question No:315 (Marks:1) Vu-Topper RM
JSP technology is extensible
True
False
Question No:316 (Marks:1) Vu-Topper RM
Managed Bean is JavaBeans which are defined in ------------------
Configuration file
Question No:317 (Marks:1) Vu-Topper RM
Correct format of writing an EL expression is ________
For More Help Contact What’s app 03224021365
${Valid Expressions}
Question No:318 (Marks:1) Vu-Topper RM
__________operator is used to retrieve elements of arrays and
collections
Bracket [ ] operator
Visit My YouTube Channel
For Subjective and More
Important Files
Channel Name = #VuTopperRM
For More Help Contact What’s app 03224021365