100% found this document useful (1 vote)
703 views66 pages

Advance Java - Exam Sutra MCQ Book by Ur Engineering Friend

This document provides a summary and preface for an Advance Java MCQ book intended for the MSBTE summer 2020 exam. It introduces the importance of Advance Java and explains how this book is structured to cover key concepts while providing practice questions at basic, intermediate, and advanced levels to help students prepare. The preface expresses thanks to all who helped create the book and provides contact information for suggestions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
703 views66 pages

Advance Java - Exam Sutra MCQ Book by Ur Engineering Friend

This document provides a summary and preface for an Advance Java MCQ book intended for the MSBTE summer 2020 exam. It introduces the importance of Advance Java and explains how this book is structured to cover key concepts while providing practice questions at basic, intermediate, and advanced levels to help students prepare. The preface expresses thanks to all who helped create the book and provides contact information for suggestions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

5th Sem

Advance Java MCQ Book for MSBTE

Ur Engineering Friend

5th Sem
Preface

The importance of Advance Java is well known in various engineering fields.


Overwhelming response to our last year exam sutra series inspired us to create this
book. This book is structure to cover the key aspects of the subject Advance Java.

All the questions in the book are very important for the upcoming MSBTE summer
2020 exam. All care has been taken to make students comfortable in
understanding the basic concepts of the subject.

The most important part of this kit is, we are not only providing the books but the
exams too at three different levels (basic, intermediate & advanced). The students
only need to study the book and co-operate us till exam.

We wish to express our profound thanks to all those who helped in making this
book realty. Much needed moral support and encouragement is provided on
numerous occasions by our whole family. We wish to thank the entire team of Ur
Engineering Friend who has taken immense pain to get this book in time with this
quality.

Any suggestion for the improvement of the books will be acknowledged and well
appreciated.
Chapter 1: (Abstract Windowing Toolkit)

Question

Give the Abbreviation of AWT:

a. Applet windowing Toolkit


b. Abstract windowing toolkit
c. Absolute windowing toolkit
d. None of these

Question

Which is a component in AWT that can contain another components like


buttons, testfields, labels etc?

a. Window
b. Container
c. Panel
d. Frame

Question

How many types of controls does AWT support?

a. 7
b. 6
c. 5
d. 8

Question

Which class provides may methods for graphics programming?

a. Java.awt
b. Java.graphics
c. Java.awt.graphics
d. None of these

Question

Which is the container that doesn’t contain title bar and menu bars. It can have
other components like button, text field etc?

a. Window
b. Frame
c. Panel
d. Container

Question

Which object can be constructed to show any number of choices in the visible
window?

a. Choice
b. Menu
c. List
d. Checkbox

Question

By which method we can set or change the text in a label in AWT?

a. setText()
b. getText()
c. addText()
d. all of these

Question

on which side applet always executed?

a. Server side
b. Client side

Question

Which method of the applet class displays the result of applet code on screen?

a. Run() method
b. Paint() method
c. drawstring() method
d. main() method
Question

Applet can be embedded in ______

a. HTML document
b. Word document
c. Gif file
d. Rtf file

Question

Which of the following is true about applet?

a. Applets do not have a main() method.


b. Applets must run under applet viewer or web browser
c. The user I/O is not performed using java’s stream I/O class
d. All of these

Question

Executable applet is ____________

a. .applet file
b. .java html
c. .java file
d. .class file
Question

Which of the following is used to interpret and execute Java Applet Classes
Hosted by HTML?

a. Applet Viewer
b. Applet Screen
c. Applet watcher
d. Applet show

Question

Java applet are used to create _______ applications

a. Graphical
b. User interactive
c. Both a & b
d. None of the above

Question

Which of these functions is called to display the output of an applet?

a. Display()
b. Paint()
c. displayApplet()
d. show()
Question

Which of these methods is a part of Abstract Window Toolkit ( AWT )?

a. Display()
b. Paint()
c. Show()
d. All of these

Question

Which object can be constructed to show any number of choices in the visible
window?

a. Labels
b. Choice
c. List
d. Checkbox

Question

Which of the following class is derived from the container class?

a. Component
b. Panel
c. Menu component
d. List
Question

When we invoke repaint() for a java.awt.component object, the AWT invokes


the method:

a. Draw()
b. Update()
c. Show()
d. Paint()

Question

Which method executes only once ?

a. Start()
b. Stop()
c. Init()
d. Destroy()

Question

What does the following line of code do?

TextField text = new TextField(20);


a. Creates text object that can hold 20 rows of text
b. Creates text object that can hold 20 columns of text
c. Creates the object text and initializes it with the value 20
d. This is invalid code
Question

Which of these classes can be added to any container class, using the add
method defined in the container class?

a. Button
b. checkboxMenuItem
c. menu
d. menubar

Question

which of the following methods can be used to change the size of a


java.awt.component object?

a. Dimension()
b. Setsize()
c. Area()
d. Size()

Question

Which of the following methods can be used to remove a java.awt.component


object from the display()?

a. Disappear()
b. Delete()
c. Remove()
d. Hide()

Question

These two ways are used to create a Frame

1. By creating the object of Frame class ( association )


2. By extending frame class ( inheritance )

a. True
b. False

Question

The title of the frame can be set in AWT using the method.

a. setHeading
b. setTitle
c. Create Title
d. setTitle

Question

which are passive controls that do not support any interaction with the user?

a. Choice
b. List
c. Labels
d. Checkbox

Question

How many ways can we align the label in a container?

a. 1
b. 2
c. 3
d. 4

Question

By which method we can set or change the text in an Label In AWT?

a. setText()
b. getText()
c. addText()
d. all of these

Question

The various controls supported by AWT are:

a. Labels, push buttons


b. Checkbxes, choice lists
c. Scrollbars, test fields, text area
d. All of these

Question

Which layout manager places components in one of the five regions : north, south ,
east , west and center?

a. Absolute layout
b. Grid layout
c. Border layout
d. Flow layout

Question

Arranges the components horizontally:

a. Border layout
b. Card layout
c. Grid layout
d. Flow layout

Question

The most commonly used layout managers are ______.

a. Flow layout
b. Border layout
c. Grid layout
d. All of these

Question

Default layout manager for subclasses of window is _____

a. Card layout
b. Gridbag layout
c. Frame
d. Border layout

Question

Each menu is associated with a _______ list of menu items.

a. Checkbox
b. Drop-down
c. Choice
d. None of these

Question

Which class can be used to represent a checkbox with a textual label that can
appear in a menu?

a. Menu bar
b. Menuitem
c. Checkboxmenuitem
d. Menu

Question

Which abstract class is the super class of all menu related classes?

a. MenuComponent
b. MenuBar
c. MenuItem
d. CheckBoxMenuItem

Question

Menu items are added to ______

a. Menus
b. Menubar
c. Frame
d. Both a & b

Question

Dialog box does not have minimize and maximize button

a. True
b. False
Question

A dialog box is referred to as modeless if the user does not have to close it in
order to continue using the application that owns the dialog box.

a. True
b. False

Question

The ______ class displays a dialog window from which the user can select a
file.

a. Dialog
b. Filedialog
c. File
d. None of these
Chapter 2: Swings

Question

Pluggable look and feel and lightweight components are the features supported
by ________

a. Swing
b. AWT
c. Core java
d. None of these

Question

Swing is based on _____ architecture

a. Client server
b. Model view controller
c. layered
d. None of these

Question

Swing is not a part of JFC that is used to create GUI application.

a. True
b. False

Question

The java foundation classes ( JFC ) is a set of GUI components which simplify
the development of desktop applications.

a. True
b. False

Question

Following letter used a prefix to swing component.

a. A
b. S
c. G
d. J

Question

_____ is one of the features of object oriented programming that allows the
creation of hierarchical classifications.

a. Polymorphism
b. Class
c. Inheritance
d. Object

Question

In swing JButton class is derived from _________

a. AbstractButton
b. JToggleButton
c. JComponent
d. None of these

Question

The JTextComponent derives two components JTextField and ______

a. JComboBox
b. JTextArea
c. JSlider
d. All of the above

Question

In swing class hierarchy the class present at the root is ___

a. Component
b. Window
c. Container
d. Object

Question

________ pane can be used to add component to container.

a. Glsass
b. Content
c. Container
d. All of the above

Question

To represent icon file in swing label, we use

a. Setimg
b. setIcon
c. serLabelIcon
d. none of this

Question

which of the following component allows multiple selection?

a. JList
b. JComboBox
c. JLabel
d. All of the above

Question

The subclass of JToggleButton is _____

a. JButton
b. JCheckBox
c. JRadioButton
d. Both b & c

Question

The swing component classes that are used in encapusulates a mutually


exclusive set of buttons?

a. Abstractbutton
b. ButtonGroup
c. JButton
d. ImageIcon

Question

Which method of the component class is used to set the position and size of a
component?

a. setPosition
b. setBounds
c. setSize
d. none of these

Question

select the correct option

1. canvas is a component
2. scrollpane is a container

a. 1 is true and 2 is false


b. 1 is false and 2 is true
c. I & 2 both are false
d. 1 & 2 both are true

Question

The difference between scrollbar and scrollpane is __________

a. Scrollbar is component and scrollpane is container


b. Scrollbar is container and scrollpane is component
c. Scrollbar and scrollpane both are components and not containers
d. Scrollbar and scrollpane both are containers and not components

Question

Frame class extends window


a. True
b. False

Question

Which is the container class?

a. Window
b. Frame
c. Dialog
d. All of the above

Question

Following is uneditable control

a. Button
b. Textfield
c. Label
d. List

Question

Jpanel and Applet use _____ as their default layout.

a. Flowlayout
b. Gridlayout
c. Border layout
d. Gridbag layout

Question

MVC stands for ____

a. Model version control


b. Model view controller
c. Mini view controller
d. Major view controller

Question

MVC architecture is used by swing ____

a. True
b. False

Question

In swing _____ gives the visual representation of the component.

a. Model
b. View
c. Controller
d. None of these
Question

In swing the event handling task is carried out by _______

a. Model
b. View
c. Controller
d. None of these

Question

_____ represents enterprise data and the business rules that gives access to
enterprise data.

a. Model
b. View
c. Controller
d. None of these
Chapter 3: Event Handling

Question

Which of these packages contains all the event handling interfaces?

a. Java.lang
b. Java.awt
c. Java.awt.event
d. Java.event

Question

Where can the event handling code be written?

a. Same class
b. Other class
c. Anonymous class
d. All of these

Question

Which of these class is super class of all the events?

a. EventObject
b. Eventclass
c. ActionEvent
d. ItemEvent

Question

Which package provides many event classes and Listener interfaces for event
handling?

a. Java.awt
b. Java.awt.graphics
c. Java.awt.event
d. None of the above

Question

Which of these interfaces handles the event when a component is added to the
container?

a. componentListener
b. ContainerListener
c. FocusListener
d. InputListener

Question
Which of these interfaces define a method actionPerformed() ?

a. Componentlistener
b. Containerlistener
c. Actionlistener
d. Inputlistener

Question

Which of these interfaces define four methods?

a) Componentlistener
b) Containerlistener
c) Actionlistener
d) Inputlistener

Question

Which of these event will be generated if we close an applet’s widow?

a. Actionevent
b. Componentevent
c. adjustmentEvent
d. WindowEvent

Question

Which of these event is generated when a button is pressed?


a. ActionEvent
b. KeyEvent
c. WindowEvent
d. AdjustmentEvent

Question

Which of these methods can be used to obtain the command name for invoking
ActionEvent object ?

a. getCommand()
b. getActionCommand()
c. getActionEvent()
d. getActionEventCommand()

Question

Which of these interfaces define a method itemStateChanged() ?

a. ComponentListener
b. ContainerListener
c. ActionListener
d. ItemListener

Question

Which of these methods will be invoked if a character is entered?


a. keyPressed()
b. Keyreleased()
c. KeyTyped()
d. KeyEntererd()

Question

Which of these constants defined in WindowEvent class?

a. WINDOW_ACTIVATED
b. WINDOW_CLOSED
c. WINDOW_DEICONIFIED
d. ALL OF THESE

Question

Which of these events is generated by scroll bar?

a) ActionEvent
b) KeyEvent
c) WindowEvent
d) AdjustmentEvent

Question

Which of these constant value will change when the button at the end of scrollbar
was clicked to increase its value?
a. BLOCK_DECREMENT
b. BLOCK_INCREMENT
c. UNIT_DECREMENT
d. UNIT_INCREMENT

Question

Which of these methods is defined in MouseMotionAdapter class?

a. mouseDragged()
b. mousePressed()
c. mouseReleased()
d. mouseClicked()

Question

which of these methods can be used to obtain the coordinates of a mouse?

a. getPoint()
b. getCoordinates()
c. getMouseXY()
d. getMouseCoordinates()

Question

which of these is super class of all Adapter classes ?

a. Applet
b. ComponentEvent
c. Event
d. InputEvent

Question

Which of these methods can be used to obtain the coordinates of a mouse?

a. getPoint()
b. getCoordinates()
c. getMouseXY()
d. getMouseCoordinates()

Question

MouseEvent is subclass of which of these classes?

a. ComponentEvent
b. ContainerEvent
c. ItemEvent
d. InputEvent

Question

Which of these are integer constants of TextEvent class?

a. TEXT_CHANGED
b. TEXT_FORMAT_CHANGED
c. TEXT_VALUE_CHANGED
d. TEXT_SIZE_CHANGED

Question

Which of these methods is used to obtain the object that generated a


windowEvent?

a. getMethod()
b. getWindow()
c. getWindowEvent()
d. getWindowObject()

Question

Which of these methods is used to get x coordinate of the mouse?

a. getX()
b. getXCoordinate()
c. getCoordinateX()
d. getPointX()

Question

Which of these is superclass of WindowEvent class?

a. WindowEvent
b. ComponentEvent
c. ItemEvent
d. InputEvent

Question

Which event gets generated when the key is typed?

a. KEY_PRESSED
b. KEY_TYPED
c. KEY_RELEASED
d. None of these

Question

What method is used to distinguish between single, double and triple mouse
clicks?

a. getButton()
b. getPoint()
c. getClickCount()
d. getX()

Question

The getNewState() method belongs to ____

a. TextEvent Class
b. MouseEvent Class
c. WIndowEvent Class
d. KeyEvent Class

Question

For scrollbars ____ event class is used.

a. ActionEvent
b. TextEvent
c. AdjustmentEvent
d. ContainerEvent

Question

Which of the following is the highest class in the event-delegation model?

a. Java.util.EventListener
b. Java.util.EventObject
c. Java.awt.AWTEvent
d. Java.awt.event.AWTEvent

Question

When two or more objects are added as listeners for the same event, which
listener is first invoked to handle the event?

a. The first object that was added as a listener


b. The last object that was added as listener
c. There is no way to determine which listener will be invoked first
d. It is impossible to have more than one listener for a given event
Chapter 4: Networking Basics

Question

Which package contains the classes and interfaces required for Java
networking?

a. Java.io
b. Java.util
c. Java.net
d. Java.awt

Question

Which methods are commonly used in ServerScoket class?

a. Public OutputStream getOutputStream()


b. Public Socket accept()
c. Public synchronized void close()
d. None of these

Question

Which class is used to create servers that listen for either local client or remote
client programs?

a. Serversockets
b. Httpserver
c. Httpresponse
d. None of the above

Question

Which methods are commonly used in serversocket class?

a) Public OutputStream getOutputStream()


b) Public Socket accept()
c) Public synchronized void close()
d) None of these

Question

Which of these is a protocol for breaking and sending the packets to an


address across a network?

a. TCP/IP
b. DNS
c. Socket
d. Proxy Server

Question

How many ports of TCP/IP are reserved for specific protocols?

a. 10
b. 1024
c. 2048
d. 512

Question

How many bits are in a single IP address?

a. 8
b. 16
c. 32
d. 64

Question

URL stands for Uniform Resource Locator and represents on the world wide
web, such as a Webpage.

a. True
b. False

Question

Which of these classes is used to encapsulate the IP address and DNS?

a. DatagramPacket
b. URL
c. InetAddress
d. ContentHandler

Question

The DatagramSocket and DatagramPacket classes are not used for


connection-less socket programming.

a. True
b. False

Question

Which of these is a full form of DNS?

a. Data Network Service


b. Data Name Service
c. Domain Network Service
d. Domain Name Service

Question

The client in socket programming must know which informations?

a. IP address of server
b. Port Number
c. Both a and b
d. None of these

Question

Datagram is basically an information but there is no guarantee of its content,


arrival or arrival time.

a. True
b. False

Question

Port number 80 is reserved for ____ protocol.

a. FTP
b. HTTP
c. SMTP
d. Telnet

Question

While using the getLocalHost() method the exception _____ is thrown

a. UnknownHostException
b. NullHostException
c. LostHostException
d. IOException

Question

he class ____ is used for accessing the attributes of remote resource.

a. URLConnection
b. URL
c. URI
d. None of these

Question

The correct way o using server socket is ____

a. ServerSocket( int port )


b. ServerSocket( int port, int maxQueue)
c. ServerSocket( int port, it maxQueue, InetAddress localAddress)
d. All of these

Question

Which method of URL class represents a URL and it has complete set of methods
to manipulate URL in java?

a. Java.net.URL
b. Java.net.URLConnection
c. Java.net.URI
d. None of the above
Chapter 5: Interacting with Database

Question

JDBC stands for ______

a. Java Database Connectivity


b. Java Database Control
c. Java Database Components
d. None of these

Question

Which statements about JDBC are true?

a. JDBC is an API to connect to relational-, object and XML data


sources.
b. JDBC stands for Java Database Connectivity
c. JDBC is an API to access relational databases, spreadsheets and flat
files
d. JDBC is an API to bridge the object-relational mismatch between OO
programs and relational databases.

Question
Which package contains the JDBC classes?

a. Java.jdbc and javax.jdbc


b. Java.jdbc and java.jdbc.sql
c. Java.sql and javax.sql
d. Java.rdb and javax.rdb

Question

JDBC technology based drivers generally fit into how many categories?

a. 4
b. 3
c. 2
d. 5

Question

Which type of driver provides JDBC access via one or more ODBC drivers?

a. Type 1 driver
b. Type 2 driver
c. Type 3 driver
d. Type 4 driver

Question
Which type of driver converts JDBC calls into the network protocol used by
the database management system directly?

a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver

Question

Which type of driver of JDBC is called pure driver?

a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver

Question

Which type of driver of JDBC is called partly Java driver?

a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question

Which driver is efficient and always preferable for using JDBC applications?

a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver

Question

The JDBC-ODBC bridge is _____

a. Three-tired
b. Multithreaded
c. Best for any platform
d. All of the above

Question

Which driver is called as thin-driver in JDBC?

a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question

Which driver type of JDBC is used in either applet or servlet?

a. Type 1 and 2
b. Type 1 and 3
c. Type 3 and 4
d. Type 4 only

Question

Which of the following is false as far as type 4 driver is concern?

a. Type 4 driver is native protocol pure java driver


b. Type 4 drivers are 100% java compatible
c. Type 4 drivers uses socket class to connect to the database
d. Type 4 drivers can not be used with Netscape.

Question

Which of the following JDBC drivers is known as a partially java driver?

a. JDBC-ODBC bridge driver


b. Native-API driver
c. Network Protocol driver
d. Thin driver
Question

Which class has strong support of the JDBC architecture?

a. The JDBC driver manager


b. The JDBC driver test suite
c. The JDBC-ODBC bridge
d. All of these

Question

In order to transfer data between a database and an application written in the


java programming language, the JDBC API provides which of these
methods?

a. Methods on the result set class for retrieving SQL Select results as
Java types
b. Methods on the prepared statement class for sending java types as
SQL statement parameters.
c. Methods on the callable statement class for retrieving SQL OUT
parameters as java types
d. All of these
Question

The JDBC API has always supported persistent storage of objects defined in
the java programming language through the methods getObject and
setObject.

a. True
b. False

Question

What is, in terms of JDBC, a data source?

a. A datasource is the basic service for managing a set of JDBC drivers


b. A data source is the java representation of a physical data source
c. A datasource is a registry point for JNDI-services
d. A data source is a factory of connections to a physical data source

Question

Which of the following describes the correct sequence of the steps involved
in making a connection with a database?

1. Loading the driver


2. Process the result
3. Making the connection with the database
4. Executing the SQL statements
a. 1,3,4,2
b. 1,2,3,4
c. 2,1,3,4
d. 4,1,2,3

Question

Which of the following methods are needed for loading a database driver in
JDBC?

a. registerDriver() method
b. Class.forName()
c. Both a & b
d. getConnection()

Question

Which type of statement can execute parameterized queries?

a. preparedStatement
b. parametrizedStatement
c. CallableStatement
d. All of these

Question

What is used to execute parameterized query?

a. Statement Interface
b. PreparedStatement Interface
c. ResultSet Interface
d. None of the above

Question

Which of the following encapsulates an SQL statement which is passed to


the database to be parsed, compiled, planned and executed?

a. DriverManager
b. JDBC driver
c. Connection
d. Statement

Question

Which of the following is used to call a stored procedure?

a. Statement
b. PrepareStatement
c. CallableStatement
d. CalledStatement

Question

What happens if you call deleteRow() on a ResultSet Object?


a. The row you are positioned on is deleted from the ResultSet, but not
from the database
b. The row you are positioned on is deleted from the ResultSet and from
the database
c. The result depends on whether the property synchronize with
DataSource is set to true or false
d. You will get a compile error

Question

The JDBC-ODBC bridge supports multiple concurrent open statements per


connection.

a. True
b. False

Question

All raw data types should be read and uploaded to the database as an array of
_____

a. Byte
b. Int
c. Boolean
d. Char

Question
Are prepared statements actually compiled?

a. Yes
b. No

Question

When the message “No suitable driver” occurs?

a. When the driver is not registered by class.forname() method


b. When the user name, password and the database does not match
c. When the JDBC database URL passed is not constructed properly
d. When the type 4 driver is used

Question

Database system compiles query when it is ____

a. Executed
b. Initialized
c. Prepared
d. Invoked

Question

_______ is an open source DBMS product that runs in window as well as Linux.

a. JSP/SQL
b. MySQL
c. Microsoft Access
d. SQL Server

Question

To execute a statement, we invoked method _______

a. executeUpdate method
b. executeRel method
c. executestmt method
d. executeConn method

Question

method on resultset that tests whether or not there remains at least one
unfetched tuple in result set, is said to be

a. fetch method
b. current method
c. next method
d. access method

Question

the ResultSet.next method is used to move to the next row of the ResultSet,
making it the current row.

a. True
b. False

Question

ResultSet object can be moved forward only and it is updatable.

a. True
b. False

Question

Which JDBC drivers will run your program?

a. The JDBC-ODBC bridge


b. The JDBC driver manager
c. The JDBC driver test suite
d. None of the above

Question

JDBC is a java API that is used to connect and execute query to the database.

a. True
b. False
Chapter 6: servlets

Question

The Java ___ specification defines an application programming interface for


communication between the web server and the application program.

a. Servlet
b. Randomize
c. Applet
d. Script

Question

Which method is used to specify before any lines that uses the PintWriter?

a. setPageType()
b. setContextType()
c. setContentType()
d. setResponseType()

Question

what are the functions of servlet container?

a. Lifecycle management
b. Communication support
c. Multithreading support
d. All of the above

Question

What is bytecode?

a. Machine-specific code
b. Java code
c. Machine-independent code
d. None of these

Question

What type of servlets use these methods doGet(), doPost(), doHead(),


doDelete(), doTrace() ?

a. Generic Servlets
b. HttpServlets
c. All of the above
d. None of these

Question

Web server is used for loading the init() method of servlet.

a. True
b. False

Question

Which package represent interfaces and classes for servlet API?

a. Javax.servlet
b. Javax.servlet.http
c. Both a & b
d. None of these

Question

What is the lifecycle of a servlet?

a. Servlet class is loaded


b. Servlet instance is created
c. Init, service, destroy method is invoked
d. All of these

Question

What is the difference between servlet and applet?

a. Servlets execute on servers while applets execute on browser


b. Servlets create static pages while applets create dynamic pages
c. Servlets can exec ute single request while applets execute multiple
requests
d. None of these

Question

A deployment descriptor descirbes

a. Web component response setting


b. Web component settings
c. Web component request settings
d. All of these

Question

Which object is created by the web container at time of deploying the project?

a. servletConfig
b. servletContext
c. both a & b
d. none of these

Question

In HTTP request method Get request is secured because data is exposed in URL
bar

a. True
b. False

Question

Which class can handle any type of request so that is protocol-independent?

a. GenericServlet
b. HTTPServlet
c. Both a & b
d. None of these

Question

Servlet technology is used to create web application

a. True
b. False

Question

The doGet() method extracts values of the parameter’s types number by using
_______

a. Response.getAttribute()
b. Response.getParameter()
c. Request.getParameter()
d. Request.setParameter()

Question

Dynamic interception of requests and responses to transform the information is


done by ____

a. Servlet filter
b. Servlet config
c. Servlet container
d. Servlet context

Question

The life cycle of a servlet is managed by ________

a. http and https


b. servlet context
c. servlet itself
d. servlet container

Question

which method take a string not a URL?

a. sendRedirect
b. forward
c. both
d. none

Question

which method shows the client what server is receiving?

a. doGet
b. doOption
c. doTrace
d. doPost

Question

What type of servlets use these methods doGet(), doPost(), doHead(),


doDelete(), doTrace()?

a. Generic servlets
b. Httpservlets
c. All of these
d. None of these

Question

Which of the following are session tracking techniques?

a. URl rewriting, using sessionobject, using cookies, using hidden fields


b. URL rewriting, using servlet object, using response object, using cookies
c. URL rewriting, using session object, using response object, using hidden
field

Question

Which methods are used to bind the objects on HttpSession instance and get the
objects?

a. setAttribute
b. getAttribute
c. both a & b
d. none of these

Question

sessions is a part of the session tracking and it is for maintaining the client state
at server side.

a. True
b. False

Question

Which cookies it is valid for single session only and it is removed each time
when the user closes the browser?

a. Persistent cookies
b. Non-persistent cookies
c. All of these
None of these

Question

Which method in session tracking is used in a bit of information that is sent by


a web server to a browser and which can later be read back from browser?

a. HttpSession
b. URL rewriting
c. Cookies
d. Hidden form fields
This is not the End, but the Beginning

Thank You

Social Media Handle:

YouTube Channel Name – Ur Engineering Friend

You might also like