MCQ Bank
How many simultaneous connections can be opened using TCP and UDP ports?
- A) 128
- B) 64k
- C) 64
- D) 128k
Which Java package is used for socket programming?
- A) java.net
- B) java.sql
- C) java.util
- D) java.lang
Timers are constructed by specifying both a delay parameter and a/an _________ Listener.
- A) Action
- B) Key
- C) Mouse
- D) Window
Which method of ServerSocket class is used to accept incoming client connections in Java?
- A) connect()
- B) open()
- C) bind()
- D) accept()
Which keyword is used in Java to mark fields that should not be serialized?
- A) transient
- B) final
- C) static
- D) volatile
How many ports are available for UDP socket?
- A) 64
- B) 128
- C) 128k
- D) 64k
In order to include graphics in your Java program, it is mandatory to extend from _________ class.
- A) JFrame
- B) JLabel
- C) JPanel
- D) JButton
Which of the following methods takes the place of constructor in an Applet?
- A) main()
- B) init()
- C) start()
- D) run()
FTP (File Transmission Protocol) works on _________ port.
- A) 23
- B) 21
- C) 80
- D) 84
In Java Graphics, while painting a swing component, which of the following functions is invoked first?
- A) paintComponet( )
- B) paint( )
- C) paintBorder( )
- D) paintChildern( )
Which method is called when an applet is about to be removed from memory?
- A) stop()
- B) destroy()
- C) start()
- D) init()
A port is a __________________ to which processes can listen for connections request.
- A) Local Address
- B) Transport Address
- C) Client Address
- D) Server Address
An applet can be defined as:
- A) A small program written in JSF and included in an HTML page
- B) A small program written in JSP and included in an HTML page
- C) A small program written in Java and included in an HTML page
- D) A small program written in Servlet and included in an HTML page
Which of the following statements is true regarding paintChildren() method?
- A) It first paints the background and then performs custom painting.
- B) It tells any components contained by this component to paint themselves.
- C) It tells the component to paint its border.
- D) It first performs custom painting and then paints the background.
Which of the following is the correct syntax to make a PersonInfo class into a Serializable class?
- A) public class PersonInfo imports Serializable { /* class body */}
- B) public class PersonInfo includes Serializable { /* class body */}
- C) public class PersonInfo extends Serializable { /* class body */}
- D) public class PersonInfo implements Serializable { /* class body */}
If a JPanel has a triangle drawn on it then which of the following methods will display it?
- A) paintChildern( )
- B) paintBorder( )
- C) paint( )
- D) paintComponet( )
Which of the following is NOT true about paintComponent( ) method?
- A) Tells the components border (if any) to paint.
- B) It is a main method for painting
- C) It performs custom painting (drawing circle, rectangles etc.)
- D) By default, it first paints the background
The newly created thread can be moved to "Ready State" by calling _______________ method.
- A) start()
- B) wait()
- C) sleep()
- D) yield()
Inside <servlet-mapping> tag, first write _____________ of the servlet using ______________ tag in web.xml.
- A) class, <servlet-class>
- B) url, <url-pattern>
- C) name, <servlet-name>
- D) url, <servlet-url>
The webapps folder is the _______ Tomcat directory that contains all the web applications deployed on the server.
- A) mid-level
- B) bottom-level
- C) least-level
- D) top-level