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

Module Test2

Uploaded by

yuvraj31156
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Module Test2

Uploaded by

yuvraj31156
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

1.Which exception will occur if specified port number is not available ??

A. UnknownException
B. SocketException
C. UnknownSocketException
D. UnknownPortException

2.Which constructor will you use to send packet?

A. DatagramPacket(byte[] bar, int len)


B. DatagramPacket(byte[] bar, int len, int port)
C. DatagramPacket(string s1, int len, InetAddress, int port)
D. All of the above

3.Java DatagramSocket and DatagramPacket classes are used for __________programming

A. Connection-oriented
B. Connection-less
C. A&B
D. Reliable

4.Datagram Packet is a message than can be used for _________ messages

A. Connection-oriented or connection less


B. send and store
C. send and receive
D. receive and read

5.getData() & getLenght() are the methods of ___________ class

A. DatagramSoclet
B. ServerSocket
C. DatagramPacket
D. ClientSocket

6.Which of the following are ways to create a Frame?

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


B. By extending Frame class (inheritance)
C. a and b
D. none of these
7.Give the abbreviation of AWT?

A. Applet Windowing Toolkit


B. Abstract Windowing Toolkit
C. Absolute Windowing Toolkit
D. None of the above

8.How would you set the color of a graphics context called g to cyan?

A. g.setColor(Color.cyan);
B. g.setCurrentColor(cyan);
C. g.setColor("Color.cyan");
D. g.setColor(new Color(cyan));

9.Which of the following are methods of the Graphics class?


a. drawRect( )
b. drawImage( )
c. drawPoint( )
d. drawString( )

A. a , b and c
B. a , c and d
C. b,c and d
D. a, b and d

10.Which of the following is not a constructor of JTree Class


(A) JTree(Object obj[])
(B) JTree(int x)
(C) JTree(TreeNode tn)
(D) JTree()

11............. method is used to execute CREATE Table query.


A. executeQuery()
B. executeUpdate()
C. execute()
D. All of the above
12. Which of the following classes are derived from the Container class. correct answers.
a. Component
b. Panel
c. Dialog
d. Frame

A. b ,c and d
B. a ,b and c
C. a and b
D. all of above

13. Which are the parameters of setString() method?


A. String value,String paramIndex
B. String paramIndex, String value
C. int paramIndex, int value
D. int paramIndex, String value

14.What is the return type of executeQuery() method?


A. int
B. connection
C. ResultSet
D. None of the above

15. Which of these package contains classes and interfaces for networking?
A. java.io
B. java.util
C. java.net
D. java.network

16. Label lb=new Label("Advanced Java");Which method is used to obtain outJava"


A. setText()
B. setLabel()
C. getText()
D. getLabel()

17. By using ___________ control, we can create a set of mutually exclusiwhich one and only one
checkbox in the group can be checked at a time.
A. Button
B. Checkbox
C. CheckboxGroup
D. List
18.Superclass of TextField and TextArea classes that is used to create Multiple textfields are
A. TextBox
B. TextComponent
C. Checkbox
D. Choice

19Subclass of TextComponent is
A. TextArea
B. Button
C. Label
D. Checkbox.

20. Which of these is a protocol for breaking and sending packets to an adnetwork?
A. TCP/IP
B. DNS
C. Socket
D. Proxy Server

21. Which of the following is not an AWT class?


A. Label
B. CheckboxGroup
C. RadioButton
D. List

22. How many ports of TCP/IP are reserved for specific protocols?
A. 10
B. 1024
C. 2048
D. 512

23. Swing components that don't rely on Native GUI are reffered to as ____A. GUI component

B. heavy weight component

C. Ligthweight component

D. middle weight component


24. How many bits are in a single IP address?

A. 8

B. 16

C. 32

D. 64

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

A. display()

B. paint()

C. displayApplet()

D. PrintApplet()

26. _____AWT Component is used to select only one item from popup list of

A. Button

B. Choice

C. Checkbox

D. All of above

27. Which of these methods can be used to output a string in an applet?

A. display()

B. print()

C. drawString()

D. String()

28. How many bits value does IPv4 and IPv6 uses to represent the address?

A. 32 and 64

B. 64 and 128

C. 32 and 128

D. 64 and 64
29.In Swing Buttons are the subclasses of which class?
A. AbstractButton
B. Button
C. Both A & B
D. None of the above

30. The__________method is automatically called the first time the applet screen and every time the
applet receives focus.
A. update( )
B. paint( )
C. repaint( )
D. reupdate( )

31.In Swing ____________is a component that displays rows and columns


A. Tabpane
B. Table
C. Scrollpane
D. None of the above.

32. Port number 80 is reserved for


A. FTP
B. Telnet
C. e-mail
D. HTTP

33. What is the purpose of JTable?


A. JTable object displays ONLY rows
B. JTable object displays ONLY columns
C. JTable object displays both rows and columns
D. JTable object displays data in Tree form
34. MVC is composed of three components:
A. Member Vertical Controller
B. Model View Control
C. Model View Controller
D. Model Variable Centered

35. __________method is used to know the type of content used in the URL.
A. ContentType()
B. Contenttype()
C. GetContentType()
D. getContentType()

36. To hold component ___________ are used


A. Container
B. AWT
C. Both
D. None

37. What are the steps for the execution of an MVC project?
A. Receive first request for the application
B. Performs routing
C. Creates MVC request handler
D. All of the above

38. Which method of a Frame object is used to place a GUI component ?


A. insert( Component c )
B. add( Component c )
C. draw( Component c )
D. click( Component c )
39. Which class is used to encapsulate IP address and DNS?
A. URLConnection
B. Telnet
C. DatagramPacket
D. netAddress

40. What is the return type of getString() method?


A. String
B. int
C. byte
D. short

41. Which of the following methods cannot be called on JLabel?


A. setIcon()
B. getText()
C. setLabel()
D. setBorderLayout()

42. The Transmission Control Protocol is


A. Low level routing protocol
B. Middle level routing protocol
C. Higher level routing protocol
D. None of above

43. The elements of a _________ Layout are organized in a top to bottom, lpattern.
A. Grid
B. Border
C. Card
D. Flow
44. Cookies were originally designed for
A. Client-side programming
B. Server-side programming
C. Both Client-side & Server-side programming
D. web programming

45. What happens if setSize() is not called on a JFrame ?


A. The window is displayed at its preferred size
B. The window is not displayed
C. The window is displayed at its absolute size
D. Only the title bar appears

46. Which packages contains JDBC classes?


A. java.jdbc
B. java.jdbc.sql
C. java.sql
D. java.rdb

47. ODBC stands for?


A. Open database connectivity
B. Open database concept
C. Open database communications
D. None of the above

48. Which of the following is the default layout for a applet?


A. Grid Layout
B. Card Layout
C. Border Layout
D. Flow Layout
49. Which method is used to set the layout of a container?
A. startLayout()
B. initLayout()
C. layoutContainer()
D. setLayout()

50. Which statement about JDBC are true


A. JDBC is an API to connect relational-object and XML data sourses
B. JDBC stands for Java Database Connectivity
C. JDBC is an API to access relational database.
D. JDBC is an API to bridge the object-relational mismatch between OO prorelational databases

You might also like