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

AJP_QB_

Uploaded by

bhoyepooja93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

AJP_QB_

Uploaded by

bhoyepooja93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

NIT’s Late Annasaheb Patil Polytechnic, Nashik-422003

(2024-25)
Course Name: Computer Engineering Course Code: CO
Subject : Advance Java Programming(22517) Semester: 5I

UNIT 3
Q1.The following steps are required to perform implement the listener interface and overrides its
methods register the component with the listener

a) Exception Handling b) String Handling

c)Event Handling d) None of the above

Q2. Action event is applied on_____

a)frame b)checkbox,choice,list c)scrollbar d)button,textfield,list,menu

Q.3 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

Q.4 The ActionListener interface is used for handling action events, For example, its used by a

a) JButton b) JCheckbox
c) All of these d) JMenultem

Q.5 Which of the following method is used to determine the type of adjustment event?

a) getType( ) b) getEventType( )
c) getAdjustmentType( ) d) getEventObjectType()

Q.6 VoidKeyTyped(KeyEvent Ke) called when a key on the keyboard


is________

a) pressed and the released b)pressed c)released d)None of the above

Q.7The signature for the registration method for a ActionEvent should be

a) public void addActionListener(ActionEvent L)


b) public void setAction(ActionListener L)
c) public void setActionListener(ActionListener L)
d) public void addActionListener(ActionListener L
Q.8 ___________method is used to register a keyboard event listenener
a) KeyListener ()
b) addKeyListener ( )
c) addKeyListenerEvent ( )
d) eventKeyboardListener ( )
Q9 .How to obtain the command name for invoking
ActionEvent?
a) getCommandName()
b) getActionEventComamnd()
c) getActionCmd()
d) getActionCommand()

Q.10 Which of the following is not the method of handling window event?
a)void windowClosed(WindowEvent we) b)voidWindowClosing(WindowEvent we

c)void windowAfterClosing() d)All of these

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

Q.12 Which of the following method must be overridden in the order to handle KeyEvent

a) keyPressed(KeyEvent Obj) b) KeyReleased(KeyEvent obj)


c) KeyTyped(KeyEvent obj) d) All of these

Q13.Select the proper output for following code

Import java.awt.*;

import java.applet.*;

public class list2 extends Applet {

public void init(){

List l= new
List (2,true);
l.add("java")

l.add("c++");

l .add("kkk"); add(l);

/*<applet code=list2.class height=200 width-200>


</applet>*

a)
b)

c)

d)

Q.14 Textfield generates ______________ event


a) ActionEvent , ItemEvent
b) ActionEvent, TextEvent
c) ScrollEvent , TextEvent
d) ActionEvent , ScrollEvent
Q.15 Which event is g enerated when the position
of scrollbar is changed?
a) KeyEvent
b) MouseEvent
c) ItemEvent
d) AdjustmentEvent
Q 16. ComponentEvent is the super class of------------
a) FocusEvent
b) MouseEvent
c) WindowEvent
d) All of the above
Q17.The ActionListener interface is not used for
handling action events?
a) True
b) False
Q18. In which places can put the event handling code
a) Same class
b) Other class
c) Annonymous class
d) All mentioned above
Q19. The is an object that is notified when an event occurs.
a) Listener b) Source
c)Event d) None of the above
Q20. Button Control implements following listener
interface.
a) ItemListener
b) ActionListener
c) FlowListener
d) InputListener

UNIT 4
Q.1UDP standsfor____
a) User Data Port b) User Datagram Protocol
c) Used Data Provider d) User Data Protocol

Q.2Name the class which is used to create a port where the server will listen

a) server b) socket c)ServerSocket d)SocketServer

Q3 communication using TCP protocol is____and____

a) Connection less,iterative
b) Collection less ,concurrent
c) Connection oriented ,iterative
d) Connection oriented,concurrent

Q.4 Which from the below use "Middle tied.


a)3 tier b) 4 tier c) n-tier d) all of the above

Q.5 java.net package consists of interface


a) ContentHandlerFactory b) SocketImplFactory
c) FileNameMap and URLStreamHandlerFactory d) All of the above

Q.6 IPv6 uses____

a) 4 groups of 8bits each


b) 4groups of 8 hexadecimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa decimal digits each

Q.7Port number for FTP

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

Q.8 Select full form of DNS

a) Data Network System


b) Domain Name System
c) Domain Name Server
d) Domain Naming Service

Q.9 int getServerPort( ) method


a) returns the port number on which this request was received
b) returns the port name on which the request was received
c) returns the server number on which this request was received
d) returns the port number on which this response/request was
received.
Q.10 A server socket can connect to ____clients

a) 1
b) 2
c) 10
d) multiple

Q.11 Which of these method of DatagramPacket class is used to find the destination address?

a) findAddress ( )
b) findAddress ( )
c) address ( )
d) whols ( )

You might also like