Ajp MCQ
Ajp MCQ
4. What is used to store partial data results, as well as perform dynamic linking ,return
value for methods, and dispath exceptions?
a) Frame
b) Button
c) Container
d) Window
6. _____ interface is implemented by objects that need to be notified when they are
bound to or unbound from an Http session
a) SessionBindingListener
b) HttpSessionBindind
c) HttpBindingListener
d) HttpSessionBindindListener
1|Page
7. ___ Returns true if the server created the session and has not yet been accessed by
the client.
a) isNew()
b) invalidate()
c) getLastAccessedTime()
d) None
8. Wash statements are correct about GDBC transactions
a) Earth transaction is a set of successfully executed statement in database
b) Earth transaction is up finished when commit() or rollback() Is called on the
Connection object.
c) Transaction is finished when closed() It’s called on Connection object
d) A transaction is finished when commi()t or rollback() is called on the transaction
object
10. When a components its added to and removed from a container ____
a) ComponentEvent
b) WindowtEvent
c) FrameEvent
d) COntainerEvent
13. The ___ Method returns reference to a component that was added to or not
removed from the container
a) getParent()
b) get()
2|Page
c) getTime()
d) getChild()
18. The default layout manager for content pain of swing is ____
a) CardLayout
b) GridLayout
c) GridBagLayout
d) BorderLayout
19. Which method is used to add tool tip text to almost all components of java swing?
a) setToolText(String s)
b) getToolTipText()
c) setToolTip(String s)
d) getToolTipText(String s)
3|Page
20. Select correct statement to add component in South region ______
a) add(component obj,FlowLayout_SOUTH)
b) add(component obj,BorderLayout_SOUTH)
c) add(component obj,BorderLayout_RIGHT)
d) add(component obj,FlowLayout_RIGHT)
22. Lebel lb = new Label(“ Advance Java”); Which method is used to obtain output as
‘Advanced Java’
a) getText()
b) setLabel()
c) setText()
d) getLabel()
23. what is the result of following applet code
Import java.applet.JApplet;
Import javax.swing.*;
4|Page
23. ___________ Returns an array of cookies in this request
a) Cookie[] getMaxCookies0
b) Cookie[] getCookies0
c) Cookie[] getMinCookies0
d) None
24. _________ method return to if the cookie contains session id otherwise return false
a) boolean isRequestedSessionId()
b) boolean isRequestedSessionIdFromCookie()
c) boolean isSessionIdFromCookie()
d) None
26. select method used to expose detail of connection extending between server
shocked of client socket
a) connect()
b) close()
c) There is no search method
d) bind()
27. Can we receive a whole row data at once instead of calling an individual
ResultSetgetXXX method for each columns?
a) Yes
b) No
c) Statement is incorrect
d) Cant predict
28. __ Method invalidate this session and removes it from the context ?
a) void removeAttribute()
b) void validate()
c) void verify()
d) void invalidate()
5|Page
Socket s1 = ss.accept()
System.out.println(s1.getport());
a) Quote the number of client socket
b) 1234
c) local port
d) host name
30. Select method which returns the destination Inetddress typically used for sending
a) Int getPort()
b) Int getLenght
c) Inetaddress getAddress()
d) byte[] get Data()
33. What happens if server socket is not able to listen or specified port ?
a) Their system exits Gracefully with appropriate message
b) The system will wait till port is free
c) IOException is thrown when opening the socket
d) PortOccupiedException is thrown
34. Add the root of the Java event class hierarchy is ____
a) EventObject
b) ComponentEvent
c) WindowEvent
d) ContainerEvent
6|Page
b) Resultset
c) Int
d) Void
36. Match pairs
a) getSource() i) Determine the type of the event
b) toString () ii) Retains the source of the event
c) getID() iii) Constructor
d) EventObject(Object src) iv) Returns the string equivalent of the event
37. Which of the following is a character sequence activity to perform for database
connectivity in Java
a) Register the driver class- Create statement – Create connection – Execute queries
– Close connection
b) Create Connection – Create statement – Register the driver class – Execute
queries - Close connection
c) Create connection – Register the driver class – Create statement – Execute
queries - Close connection
d) Register the driver class – Create connection – Create statement – Execute
queries – close connection
7|Page
c) ParameterizedStatement and CallableStatement
d) All kinds of statement
42. EP over application has successfully bound to specified port and ready for client
request then ______
a) An exception is thrown
b) An io exception is thrown
c) It doesn’t throw an exception
d) UnknownHostException is thrown
43. You can simply use InetAddress class when working with IP addresses because it can
accommodate both _______
a) IPV4 and IPV6
b) IP4V and IP6V
c) Poster name and IP
d) Host and port
44. The example of user interface a limit that implement the ItemSelectable interface
a) Choice and text box
b) Textbooks and lists
c) List and choice
d) List and canvas
8|Page
b) The JDBC driver Manager
c) JDBC ODBC bridge
d) All
47. ___________ Is the class representing event notification for changes to session
within a web application.
a) Httpserviet
b) HttpSessionevent
c) Cookies
d) None
49. _______ Calls get converted into native c or c++ API calls
a) API
b) JDBC API
c) ODBC
d) None
50. ______ Method adds failed to the header with dead value equal to msec.
a) void setDate(String field,long msec)
b) void Dataheader(long msec)
c) void DateHeader(String field, int msec)
d) void setDateHeader(String field, long msec)
9|Page
10 | P a g e