Advanced Java
Advanced Java topics including networking (InetAddress, Socket, DatagramPacket), AWT components and events, graphics, and applets
Questions
Which of the following methods of InetAddress class returns a string that represents the host address associated with the InetAddress object?
- getaddress()
- getHostAddress()
- getHostName()
- hashCode()
- toString()
Which of the following methods of Applet class is used to return a string that describes the applet?
- getAppletContext()
- getAppletInfo()
- getCodeBase()
- getDocumentBase()
- destroy()
Which of the following event classes of java.awt.event package is generated when a check box or list item is clicked?
- ActionEvent
- AdjustmentEvent
- ItemEvent
- ComponentEvent
- FocusEvent
Which of the following event classes of java.awt.event package is generated when input is received from the keyboard?
- KeyEvent
- MouseEvent
- TextEvent
- WindowEvent
- InputEvent
Which of the following methods of Socket class in java returns the local port to which Socket object is connected?
- getInetAddress()
- getPort()
- getLocalPort()
- Socket()
- getInputStream()
Which of the following methods is used in java to format an HTML page to send back to web clients, who make requests that cannot be completed?
- toBytes()
- getRawRequest()
- writeString()
- error()
- writeUCE()
Which of the following events requires adjustment events when used in the Applet?
- Button
- Checkbox
- List
- Scrollbar
- Choice
Which of the following classes is used to display any components in a two-dimensional grid?
- List
- GridLayout
- MenuBar
- Image
- MenuComponents
Which of the following methods of Font class is used to return the logical name of the invoking font?
- getName()
- getSize()
- getStyle()
- isBold()
- getFontName()
Which of the following event listener interfaces defines one method to recognize when a text value changes?
- KeyListener
- ItemListener
- TextListener
- FocusListener
- ActionListener
Which of the following classes in Java encapsulates various information related to a font, which helps a user to display text in a window?
- Frame
- Graphics
- FontMetrics
- Font
- Event
Which of the following classes is used to create a window from which a file can be selected?
- Color
- Dialog
- FileDialog
- Dimension
- Checkbox
Which of the following flags of ImageObserver interface is used to show a complete frame that is part of a multiframe image?
- SOMEBITS
- FRAMEBITS
- ALLBITS
- ERROR
- WIDTH
Which of the following methods of AppletContext interface returns an audio clip object that encapsulates the audio clip found at the location specified as URL in the method?
- getApplets()
- getImage()
- showDocument()
- getAudioClip()
- showStatus()
Which of the following methods of DatagramPacket is used to return the byte array of data contained in the datagram?
- getAddress()
- getPort()
- getData()
- getLength()
- close()
Which of the following methods of Applet class is used to to verify whether an applet is started or not?
- isActive()
- init()
- start()
- stop()
- getImage()