0% found this document useful (0 votes)
48 views

AJP (22517) QB (Unit 3,4,5,6)

Advance java

Uploaded by

Dipak Gawali
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
0% found this document useful (0 votes)
48 views

AJP (22517) QB (Unit 3,4,5,6)

Advance java

Uploaded by

Dipak Gawali
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/ 27

Advanced Java Programming (22517) MCQ

S.S.V.P.S.Bapusaheb Shivajirao Deore Polytechnic ,Dhule


DEPARTMENT OF COMPUTER ENGINEERING
Question Bank for Multiple Choice Questions
Course: Advanced Java Programming Course Code: 22517
Program : CO5I Semester : V

Unit 3 : Event Handling Marks : 12

1) Which of these packages contains all the classes and methods required for event
handling
a) java.applet
b) java.awt
c) java.event
d) java.awt.event

2) What is an event in delegation event model


a) An event is an object that describes a state change in a source
b) An event is an object that describes a state change in processing
c) An event is an object that describes any change by the user and system
d) An event is a class used for defining object, to create events

3) Which of these methods are used to register a KeyEvent listener?


a) KeyListener()
b) addKistener()
c) addKeyListener()
d) eventKeyboardListener()

4) Which of these methods are used to register a MouseMotionListener?


a) addMouse()
b) addMouseListener()
c) addMouseMotionListner()
d) eventMouseMotionListener()

5) EventObject class is defined in which of these libraries?


a) java.io
b) java.lang
c) java.net
d) java.util

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


a) EventObject
b) EventClass

Page 1 of 27
Advanced Java Programming (22517) MCQ

c) ActionEvent
d) ItemEvent

7) Which of these events will be generated if we close an applet’s window?


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

8) ____Event is generated when Button is pressed


a)ItemEvent
b)WindowEvent
c)ActionEvent
d)ClickEvent

9) ____Event is generated when Checkbox is selected


a)ItemEvent
b)WindowEvent
c)ActionEvent
d)ClickEvent

10) ____Event is generated when List item is double clicked


a)ItemEvent
b)WindowEvent
c)ActionEvent
d)ClickEvent

11) Event generated can be handle by implementing interfaces called as__


a)InterfaceGroup
b)Listener
c)ListenerGroup
d) EventHandlerClass

12) The component on which event is generated is called as ____


a)Source
b)Event
c)Listener
d)None

13) _____ method return the name on component on which event is generated
a)getActionCommand()
b)getSource()
c)getName()
d)getByName()

Page 2 of 27
Advanced Java Programming (22517) MCQ

14) To get the state of Checkbox ____ method is used


a)getState()
b)get()
c)getbyState()
d)statereturn()

15) getX() is a method of ___


a)MouseEvent
b)MouseMotionEvent

16) getY() is a method of ___


a)MouseEvent
b)MouseMotionEvent

17) Which of the following is not method of Mouselistener


a)mouseExited()
b)mouseClicked()
c)mousePressed()
d)mouseMoved()

18) Which model is used to handle event


a)Model View Controller
b)Delegation Model

19) Which of the following is Event Handler


a)Source
b)Listener
c)Event
d)Object

20) Listener is group of ____


a)Interfaces
b)Event
c)Object
d)Classes

21) To handle ActionEvent which method of listener have to override


a)actionPerformed(ActionEvent ae)
b)ActionPerformed(ActionEvent ae)
c)ActionPerformed(actionEvent ae)
d)actionPerformed(Action Event ae)

22) Which of the following is not method for MouseListener


a)mousePressed(MouseEvent me)
b)mouseClicked(MouseEvent me)
c)mouseReleased(MouseEvent me)

Page 3 of 27
Advanced Java Programming (22517) MCQ

d)mouseListener(MouseEvent me)

23) The class with no name is call ____


a)Inner class
b)Outer Class
c)Anonymous class
d)Local Inner Class

24) Can we generate event on TextField


a)No
b)Yes

25) Local Inner class is a ______


a)class with no name
b)class inside method
c)class inside class
d)class inside listener

26) To handle MouseEvent Adapter class create __number of method body


a)0
b)2
c)5
d)6

27) ItemListener is event handler for___


a)ActionEvent
b)WindowEvent
c)ItemEvent
d)MouseEvent

28) ActionListener is event handler for___


a)ActionEvent
b)WindowEvent
c)ItemEvent
d)MouseEvent

29) WindowListener is event handler for___


a)ActionEvent
b)WindowEvent
c)ItemEvent
d)MouseEvent

30) MouseListener is event handler for___


a)ActionEvent
b)WindowEvent
c)ItemEvent

Page 4 of 27
Advanced Java Programming (22517) MCQ

d)MouseEvent

31) TextListener is event handler for___


a)ActionEvent
b)WindowEvent
c)ItemEvent
d)TextEvent

32) Identify correct program


a) import java.awt.*;
import java.awt.event.*;
class DemoAction extends Frame implements ActionListener
{
Label l1=new Label();
DemoAction()
{
setTitle("Demo Event");
setSize(500,500);
setVisible(true);
setLayout(null);
Button b1=new Button("ok");
Button b2=new Button("Cancel");
b1.setBounds(100,50,50,20);
b2.setBounds(200,50,50,20);
add(b1);
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str1=ae.getActionCommand();
if(str1.equals("ok"))
{
l1.setText("You press Ok");
}
else if(str1.equals("Cancel"))
{
l1.setText("You press Cancel");
}
else
{
l1.setText("please press on any button ");
}
add(l1);
l1.setBounds(100,100,250,20);}

Page 5 of 27
Advanced Java Programming (22517) MCQ

public static void main(String args[])


{
DemoAction d1=new DemoAction();
}
}

b) import java.awt.*;
import java.awt.event.*;
class DemoAction extends Frame implements ActionListener
{
Label l1=new Label();
DemoAction()
{
setTitle("Demo Event");
setSize(500,500);
setVisible(true);
setLayout(null);
Button b1=new Button("ok");
Button b2=new Button("Cancel");
b1.setBounds(100,50,50,20);
b2.setBounds(200,50,50,20);
add(b1);
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str1=ae.getActionCommand();
if(str1.equals("ok"))
{
l1.setText("You press Ok");
}
else if(str1.equals("Cancel"))
{
l2.setText("You press Cancel");
}
else
{
l3.setText("please press on any button ");
}
add(l1);
l1.setBounds(100,100,250,20);
}
public static void main(String args[])

Page 6 of 27
Advanced Java Programming (22517) MCQ

{
DemoAction d1=new DemoAction();
}
}

c) import java.awt.*;
import java.awt.event.*;
class DemoAction extends Frame implements ActionListener
{
Label l1=new Label();
DemoAction()
{
setTitle("Demo Event");
setSize(500,500);
setVisible(true);
setLayout(null);
Button b1=new Button("ok");
Button b2=new Button("Cancel");
b1.setBounds(100,50,50,20);
b2.setBounds(200,50,50,20);
add(b1);
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str1=ae.getActionCommand();
if(str1.equals("ok"))
{
l1.setText("You press Ok");
}
else if(str1.equals("Cancel"))
{
l1.setText("You press Cancel");
}
else
{
l1.setText("please press on any button ");
}
add(l1);
l1.setBounds(100,100);
}
public static void main(String args[])
{
DemoAction d1=new DemoAction();

Page 7 of 27
Advanced Java Programming (22517) MCQ

}}

d) import java.awt.*;
import java.awt.event.*;
class DemoAction extends Frame implements ActionListener
{
Label l1=new Label();
DemoAction()
{
setTitle("Demo Event");
setSize(500,500);
setVisible(true);
setLayout(null);
Button b1=new Button("ok");
Button b2=new Button("Cancel");
b1.setBounds(100,50,50,20);
b2.setBounds(200,50,50,20);
add(b1);
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str1=ae.getActionCommand();
if(str1.equals("ok"))
{
l1.setText("You press Ok");
}
else if(str1.equals("Cancel"))
{
l1.setText("You press Cancel");
}
else
{
l1.setText("please press on any button ");
}
add(l1);
l1.setBounds(100,100,250,20);
}
public static void main(String args[]);
{
DemoAction d1=new DemoAction();
}
}
33) Choose the correct Error in below code

Page 8 of 27
Advanced Java Programming (22517) MCQ

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class DemoMouseEvent extends Applet implements MouseListener
{
public void init()
{
setVisible(true);
this.addMouseListener(this);
}
public void mouseEntered (MouseEvent me)
{
showStatus("Mouse Entered ");
}
public void mousePressed(MouseEvent me)
{
showStatus("Mouse Pressed ");
}
public void mouseReleased(MouseEvent me)
{
showStatus("Mouse Released ");
}
public void mouseClicked(MouseEvent me)
{
int x,y;
x=me.getX();
y=me.getY();
showStatus("Mouse Clicked at x="+x+" y="+y);
}
public void mouseExited(MouseEvent me);
{
}
}
/*<applet code="DemoMouseEvent" width=400 height ="400"></applet>*/

a)Main method not found


b)Missing Method body or declare abstract
c)Abstract method does not override
d)Program will run successfully

(Note : In question no 33 , mouseExited() method is ended with “ ;” due to which


error occurred in code .)

34) MouseEvent class is subclass of


a)ComponentEvent
b)ContainerEvent

Page 9 of 27
Advanced Java Programming (22517) MCQ

c)ItemEvent
d)InputEvent
35) The____ is an object that is notified when an event occure
a)Listener
b)Source
c)Event
d)Model

36) Clicking the closing button on the upper right corner of frame generates _____ event
a)ItemEvent
b)WindowEvent
c)MouseMotionEvent
d)ComponentEvent

37) Which of these interface define a method actionPerformed()


a)ComponentListener
b)ContainerListener
c)ActionListener
d)InputListener

38) Which listener handles all list related events?


a)ItemListener
b)InputListener
c)SelectListener
d)ListListener

39) Select the correct program for following output

a) import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

Page 10 of 27
Advanced Java Programming (22517) MCQ

public class DemoMouseMotionEvent extends Applet implements


MouseMotionListener
{
public void init()
{
setVisible(true);
this.addMouseMotionListener(this);
}
public void mouseMoved (MouseEvent me)
{
int x,y;
x=me.getX();
y=me.getY();
showStatus("Mouse moved at x="+x+" y="+y);

}
public void mouseDragged (MouseListener me)
{
showStatus("Mouse Dragged");
}
}
/*<applet code="DemoMouseMotionEvent" width=400 height ="400"></applet>*/

b)import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class DemoMouseMotionEvent extends Applet implements
MouseMotionListener
{
public void init()
{
setVisible(true);
this.addMouseMotionListener(this);
}
public void mouseMoved (MouseEvent me)
{
int x,y;
x=me.getX();
y=me.getY();
showStatus("Mouse moved at x="+x+" y="+y);

}
public void mouseDragged (MouseEvent me)
{
}
}

Page 11 of 27
Advanced Java Programming (22517) MCQ

/*<applet code="DemoMouseMotionEvent" width=400 height ="400"></applet>*/


c) import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class DemoMouseMotionEvent extends Applet implements
MouseMotionListener
{
public void init()
{
setVisible(true);
this.addMouseMotionListener(this);
}
public void mouseMoved (MouseEvent me)
{
int x,y;
x=me.getX();
y=me.getY();
showStatus("Mouse moved at x="+x+" y="+y);
}
public void mouseDragged (MouseEvent me)
{
showStatus("Mouse Dragged");
}
}
/*<applet code="DemoMouseMotionEvent" width=400 height
="400"></applet>*/

d) import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class DemoMouseMotionEvent extends Applet implements
MouseMotionListener
{
public void init()
{
setVisible(true);
this.addMouseMotionListener(this);
}
public void mouseMoved (MouseEvent me)
{
int x,y;
x=me.getX();
y=me.getY();
showStatus("Mouse moved at x="+x+" y="+y);

Page 12 of 27
Advanced Java Programming (22517) MCQ

public void mouseDragged (MouseEvent me)


{
showStatus("Mouse Dragged");
}
}

40) void keyTyped(KeyEvent ke) called when a key on the keyboard is ______
a)Pressed
b)Released
c)Pressed and Released
d)No Action Taken from Keyboard

Page 13 of 27
Advanced Java Programming (22517) MCQ

Unit 4 : Networking Basics Marks : 10

1) All the network related classes are part of ____package


a)java.awt
b)java.util
c)java.net
d)java.awt.net

2) Socket class is used at__ end


a)client end
b)server end

3) ServerSocket class is used at__ end


a)client end
b)server end

4) SocketAddress is combination of
a)Ip address and port no
b)ip address
c)port no
d)none

5) Port number are divided into ____


a)3 category
b)2 category
c)not divided
d)interfaces

6) Which of the following is not type of port number


a)Well Known Ports
b)Register Ports
c)Dynamic Ports
d)None

7) Which of the following is range of Well Known Ports


a)0 to 1023
b)1024 to 49151
c)49152 to 65535

8) Which of the following is range of Register Ports


a)0 to 1023
b)1024 to 49151
c)49152 to 65535

Page 14 of 27
Advanced Java Programming (22517) MCQ

9) Which of the following is range of Dynamic Ports


a)0 to 1023
b)1024 to 49151
c)49152 to 65535

10) Dynamic port is known as____


a)Private port
b)Public Port
c)Private and Public Port
d)None

11) Does InetAddress class have a constructor


a)Yes
b)No

12) Which of the following method is not factory method


a)getByName()
b)getByAdress()
c)getLocalHost()
d)getHostName()

13) Which of the following is more reliable


a)TCP
b)UDP

14) Which of the following is protocol working on Network Layer


a)TCP
b)UDP
c)IP
d)HTTP

15) Client send__ and server send___


a)request-response
b)response-request
c)Query-result
d)Query-output

16) TCP stands for


a)Transmission Control Protocol
b)Traffic Control Protocol
c)Technic Control Protocol
d)Transfer Control Protocol

17) UDP stands for__


a)User Data Protocol

Page 15 of 27
Advanced Java Programming (22517) MCQ

b)User Datagram Protocol


c)User Datagram Packet
d)User DataGramSocket Packet

18) HTTP stands for________


a)Hyper Text Transfer Protocol
b)Hyper Text Protocol
c)Hyper Text Traffic Protocol
d)Hyper Traffic Text Protocol

19) FTP stands for____


a)File Told Protocol
b)Folder Transfer Protocol
c)File Transfer Protocol
d)File Technic Protocol

20) Which of the following protocol is not working on application layer


a)http
b)udp
c)ftp
d)pop

21) URL class in ____Package


a)java.net
b)java.awt
c)java.util
d)java.lang

22) Which method is use with Socket() constructor __


a)accept()
b)bind()
c)connect()
d)socconnect()

23) Which method is use to get port number from Socket


a)getportno()
b)getPort()
c)getPortNo()
d)getport()

24) Which method is use with ServerSocket() constructor __


a)accept()
b)bind()
c)connect()
d)socconnect()

Page 16 of 27
Advanced Java Programming (22517) MCQ

25) ____can be skip in URL


a)protocol
b)hostname
c)portno
d)filename

26) URL stands for ______


a)Uniform Resource Locator
b)Universal Resource Locator

27) __is a administrator track responsible service protocol


a)POP
b)Whois

28) DatagramSocket() connects to________


a)Local Host,80
b)Local Host,21
c)Local Host,25
d)Local Host, Free Port

29) Duplicate port no hire ____exceptions


a)MalFormedURLException
b)UnkownHostexception
c)IOException
d)b and c

30) IPV6 consist of


a)4 groups of 8 bits each
b)4 groups of 8 HexaDecimal digit
c)8 groups of 4 Digit each
d)8 groups of 4 Hexa Decimal digit

31) DNS stands for


a)Domain Name Service
b)Domain Name Server
c)Domain Network Service
d)Domain Network server

32) Port number for FTP


a)21
b)23
c)25
d)80

33) Port number for HTTP


a)21

Page 17 of 27
Advanced Java Programming (22517) MCQ

b)23
c)25
d)80

34) A ServerSocket can connect to ___client


a)1
b)2
c)3
d)Multiple

35) The ____class is used to create TCP Server


a)Server
b)SocketServer
c)ServerSocket
d)Socket

Page 18 of 27
Advanced Java Programming (22517) MCQ

Unit 5 : Interacting With DataBase Marks : 12

1) JDBC stands for____


a)Java DataBase Connectivity
b)Java Dataset Connectivity
c)Java Driver Base Connectivity
d)Java Data Connectivity

2) ODBC is introduced by___


a)Microsoft
b)Oracle
c)Sun Microsystem
d)IBM

3) JDBC is introduced in____


a)1992
b)1994
c)1996
d)1997

4) _____is platform independent


a)ODBC
b)JDBC

5) JDBC Driver is provided by___


a)JDBC Connectivity
b)ODBC
c)JDBC API
d)Java Application

6) ____is Backbone of JDBC architecture


a)JDBC
b)ODBC
c)DriverManager
d)Driver

7) Which of the following is Interface in JDBC API


a)Connection
b)Drivermanager
c)URL
d)URLConnection

8) Which of the following is not a interface in JDBC API


a)Connection

Page 19 of 27
Advanced Java Programming (22517) MCQ

b)Statement
c)PreparedStatement
d)None

9) createStatement () is method of__


a)Statement Interface
b)Connection Interface

10) commit() is a method of____


a)Connection Interface
b)Statement Interface
c)PreparedStatement interface
d)ResultSet interface

11) Which of the following method is used to execute Select Query


a)executeQuery(qry)
b)executeUpdate(qry)

12) Boolean last() is a method of____


a)ResultSet
b)Statement

13) Java consist of__ type of drvier


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

14) Which of the following is pure Java driver


a)JDBC ODBC driver
b)Native API driver
c)Thin Driver
d)None

15) JDBC is introduced by_______


a)Microsoft
b)Sun Microsystem

16) _____is a platform dependent


a)JDBC
b)ODBC

17) ODBC supports__


a)Windows
b)linux
c)MacOS

Page 20 of 27
Advanced Java Programming (22517) MCQ

d)above all

18) JDBC supports__


a)Windows
b)linux
c)MacOS
d)above all

19) ____perform dynamic SQL


a)PrepredStatement
b)Statemet

20) ____performed static SQL


a)PrepredStatement
b)Statemet

21) ____store result of d/b


a)Result
b)getData
c)ResultData
d)ResultSet

22) All the classes related database are stoe____


a)java.database
b)java.lang
c)java.util
d)java.sql

23) getConnection() is a method of


a)Connection()
b)Statement
c)Connection
d)DriverManager

24) Can we create object of Interface


a)Yes
b)No

25) Who is responsible to select driver


a)DriverManager
b)JDBC Driver

26) Which of the following method is used to perform DML command in jdbc
a)executeQuery()
b)executeResult()
c)executeUpdate()

Page 21 of 27
Advanced Java Programming (22517) MCQ

d)none

27) Which of the following method is loads the driver


a)forName()
b)ForName()
c)FarName()
d)farName()

28) JDBC_ODBC driver is also known as?


a)Type1
b)Type2
c)Type3
d)Type4

29) JDBC Native API driver is also known as?


a)Type1
b)Type2
c)Type3
d)Type4

30) Network Protocol is also known as?


a)Type1
b)Type2
c)Type3
d)Type4

31) Thin driver is also known as?


a)Type1
b)Type2
c)Type3
d)Type4

32) Which of the following driver is platform dependent?


a)Type1
b)Type2
c)Type3
d)Type4

33) ODBC stands for


a)Online Database Connectivity
b)Other Database Connectivity
c)Open Database Connectivity
d)None

34) DriverManager is provided by__


a)JDBC Connectivity

Page 22 of 27
Advanced Java Programming (22517) MCQ

b)Driver
c)Connection
d)JDBC API

35) API stands for____


a)Application Programming Interface
b)Allow Program Interface
c)Application Programming Interchanged
d)Application Programming InterConnection

36) Statement can pass static sql


a)Yes
b)No

37) Statement can pass Dynamic sql


a)Yes
b)No

38) PrepraredStatement can pass static sql


a)Yes
b)No

39) PrepraredStatement can pass dynamic sql


a)Yes
b)No

40) Which driver is removed from java8


a)Type1
b)Type2
c)Type3
d)Type4

Unit 6 : Servlets Marks : 14

1) Which of the following code can be used to send an error response to the client using
the specified status code and clearing the buffer.

Page 23 of 27
Advanced Java Programming (22517) MCQ

a) request.sendError(statusCode)
b) response.sendError(statusCode)
c) header.sendError(statusCode)
d) None of the above.

2) Which element of web.xml is used to specify the error handler in servlets?


a) error-page
b) error-handler
c) exception
d) exception handler

3) Which of the following code sends a cookie in servlet?


a) response.addCookie(cookie);
b) response.sendCookie(cookie);
c) response.createCookie(cookie);
d) None of the above

4) JSP embeds ___ in____


a)Servlet, html
b)HTML, Java
c)HTML ,Servlet
d)Java, HTML

5) Which of the following is the default HttpRequest method


a)doGet()
b)doPost()
c)doReq()
d)init()

6) Which method is used to process a client’s request?


a)start()
b)init()
c)service()
d)destroy()

7) Apache Tomcat is___


a)Servlet
b)Java Program
c)API
d)Web server capable of running Java Program

8) A Servlet is managed by____


a)Supporting Protocol
b)Servlet Context
c)Servlet Container
d)ServletConfig

Page 24 of 27
Advanced Java Programming (22517) MCQ

9) Servlet is a program reside at ____


a)Client Side
b)Server Side

10) Identify the correct syntax


a)public void service(httprequest Req , httpresponse Resp)
b)public void service(HttpRequest Req , HttpResponse Resp)
c)public void service(ServletRequest Req, ServletResponse Resp)
d)public void service(servletRequest Req,servletresponse Resp)

11) Which of the following interface is available in javax.servlet.http package


a)GenericServlet
b)Cookie
c)HttpServletRequest
d)ServletConfig

12) Servlet configuration information obtain from___


a)source.html
b)config.java
c)web.xml
d)context.java

13) void setMaxAge(int expiry) method of ____class


a)Cookie
b)GenericServlet
c)HttpServlet
d)PrintWriter

14) ServletConfig object pass through ____method of servlet


a)init()
b)service()
c)destroy()
d)no need to pass object

15) ______ is the first phase of Servlet Life Cycle


a)service()
b)destroy()
c)init()
d)start()

16) CGI is abbreviation for


a)Common Generic Interface
b)Common Gateway Interface
c)Connection Gateway Interface
d)Container Generic Interface

Page 25 of 27
Advanced Java Programming (22517) MCQ

17) Which of the following is not method of servlet life cycle


a)init()
b)service()
c)start()
b)destroy()

18) When the data of client request is send through GET method the handling method in
servlet is __
a)doGet()
b)doPost()
c)DoGetServlet()
d)DoGetPost()

19) Which of the following is correct way to create servlet


a)By implementing ServletRequest Interface
b)By implementing ServletRsponse Interface
c)By implementing Servlet Interface
d)By implementing ServletConfig Interface

20) Which of the following is correct way to create servlet


a)By implementing ServletRequest Interface
b)By implementing ServletRsponse Interface
c)By extending GenericServlet class
d)By extending Cookie class

21) Which of the following is correct way to create servlet


a)By extending PrintWriter class
b)By implementing ServletRsponse Interface
c)By extending HttpServlet class
d)By extending Cookie class

(Note for Q19,20,21….servlet can be created in three ways i.e by implementing


Servlet interface ,extending GenericServlet and HttpServlet classes )

22) Servlet output stored in ___


a)PrintWriter
b)ServletResponse
c)HttpSession
d)HttpServletResponse

23) ServletContext object is created by___


a)web.xml(Deployment Descriptor)
b)Web Container
c)Web Server
d)Web App

Page 26 of 27
Advanced Java Programming (22517) MCQ

24) ServletConfig object is created by___


a)web.xml(Deployment Descriptor)
b)Web Container
c)Web Server
d)Web App

25) All the configuration values of servlet(used by ServletConfig and ServletContext) are
available in ____
a)web.xml(Deployment Descriptor)
b)Web Container
c)Web Server
d)Web App

26) Purpose of log(String msg) method


a)To give error message in servlet log file
b)To give message from client request
c)To give message for context
d) To Find log value

27) HttpServlet class is derived from


a) ServletResponse
b)HttpServletResponse
c)GenericServlet
d)ServletContext

28) GenericServlet class is derived from


a)HttpServlet
b)Servlet
c)Cookies
d)HttpSession

29) Session between web client and web Server can be created through
a)Cookie object
b)Session object
c)Generic servlet object
d)Connection object

30) Session between web client and web Server can be created through
a)Session object
b)HttpSession
c)Generic servlet object
d)Connection object

Page 27 of 27

You might also like