0% found this document useful (0 votes)
22 views10 pages

Ajp MCQ

Uploaded by

Ajinkya Pawar
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)
22 views10 pages

Ajp MCQ

Uploaded by

Ajinkya Pawar
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/ 10

MCQ OF AJP

1. Which of the following is constructor for HttpsessionEvent class ?


a) HttpsessionEvent()
b) HttpsessionEvent(String value)
c) HttpsessionEvent (Httpsession session)
d) None

2. Socket S1 =Socket(Localhost 1346),What does it means?


a) Client socket is waiting for connection
b) Client socket is created to connect with a specified host name and port number
c) Client’s socket is named as a local host and a port number 1346
d) Server Socrates connected to local host with port number 1346

3. ____ Method to establish actual database connection.


a) GetConnection()
b) executeUpdate()
c) executeQuery()
d) prepareCall()

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

5. In CardLayout where components of every card are added ?


a) Window
b) Frame
c) Applet
d) Panel

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

9. Generate ____ when user enters a character


a) TextField Event
b) Character event
c) Label event
d) Text event

10. When a components its added to and removed from a container ____
a) ComponentEvent
b) WindowtEvent
c) FrameEvent
d) COntainerEvent

11. Methods of ResultSet through _____ exception


a) SQLExpection
b) IO Exception
c) MethodNotFoundException
d) ResultsSetException
e)
12. MouseWheelEvent defines integer constants.
a) WHEEL_BLOCK_SCROLL,WHEEL_UNIT_SCROLL
b) BLOCK_SCROLL,UNIT_SCROLL
c) WHEEL_SCROLL,BLOCK_SCROLL
d) WHEEL_PAGE,BLOCK_SCROLL

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()

14. Identify the class which is not an adapter class?


a) ItemAdapter
b) FocusAdapter
c) KeyAdapter
d) MouseMotionAdapter

15. Identify the return type is Temporary() method


a) Int
b) Long
c) String
d) Boolean

16. Match the correct pair


a) getSource() i) Determine the type of they event
b) toString() ii) Returns the source of the event
c) getID() iii) Constructor
d) EventObject(Object src) iv) Returns the string equivalent of event

a) a-ii, b-iv , c-i, d-iii


b) a-i, b-iv , c-ii, d-iii
c) a-iii, b-iv , c-i, d-ii
d) a-iv, b-ii , c-i, d-iii
17. for developing GUI swing user ______ package
a) javax.awt
b) java.swing
c) java.awt.swing
d) javax_applet_swing

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)

21. Is accessed from the following guest HTML page


a) Prints “ Hello World”
b) Generates a compile time error
c) Does nothing
d) Generates a runtime error

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.*;

Public class Sample extends JApplet{


Private String text =” hello word”;
Public void init(){
Add(new JLabel(text));
}
Public Sample(){
Text=string;
}
}
It is excess the form the following HTML page

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

25. A servlet developer overrides which of the following methods ?


a) doDelete()
b) doGet()
c) doHead()
d) All

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()

29. What is the output of this following statement


Serversocket ss = new ServerSocket(1234);

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()

31. Public InputStream getInputStream() is method of _____ class


a) Serversocket
b) Clientsocket
c) Socket
d) URL

32. Select the character statement from following option


a) There are two kinds of sockets in Java 1 is forest server and other for clients
b) There is only one socket for server
c) There is only one socket for client
d) There is only one socket for server as well as for client

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

35. The return type of execute(string query) is ?


a) Boolean

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

a) a-ii, b-iv , c-i, d-iii


b) a-i, b-iv , c-ii, d-iii
c) a-iii, b-iv , c-i, d-ii
d) a-iv, b-ii , c-i, d-iii

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

38. Which of the following is true about cookies ?


a) Cookies are stored on client
b) Cookies contain state information
c) Cookies track user activity
d) All

39. An expiration date is not explicitly assigned to a cookie is deleted _______


a) Immediately after creation
b) Wayne current browser session ends
c) When session is expired
d) Never

40. Which type of statement can execute parameterized queries ?


a) PreparedStatement
b) ParameterizedStatement

7|Page
c) ParameterizedStatement and CallableStatement
d) All kinds of statement

41. What is the output of the following statement


ServerSocket ss = new ServerSocket(1234);
Socket s1 = ss.accept();
System.out.println(s1.gerPort());

a) Port number of client socket


b) 1234
c) Local port
d) Host name

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

45. Which of the following is not the method of CardLayout class


a) public void next(Container parent)
b) public void display(Container parent)
c) public void previous(Container parent)

46. Which class has a strong support of the JDBC Architecture ?


a) JDBC Driver tester suite

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

48. The ____ Is Invoked when hormone webpage is submitted.


a) Session
b) Servlet
c) Cookie
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)

51. Which of the following are method of HttpServlet class ?


a) setComment()
b) doDelete() only
c) doGet() only
d) b and c

9|Page
10 | P a g e

You might also like