Syvum Home Page

Home > Quiz Games > Java Programming >

Java Programming : java.awt and java.io : Multiple Choice


Learn about java.awt and java.io packages.

Formats Info Page Worksheet / Test Paper Quiz Review
Multiple choice

Your Performance  

1.

The setBackground() method is part of the following class in java.awt package:

  Component

  Graphics

  Applet

  Container

  Object

  Half-n-half Clue
 

2.

Which of the following strings can be used as mode strings for creating a RandomAccessFile object?
(A) "r"
(B) "w"
(C) "rw"
(D) "wr"
(E) "0"

  (A) & (C)

  (A), (B), (C) & (E)

  (A), (B) & (C)

  (C) & (D)

  (B), (D) & (E)

  Half-n-half Clue
 

3.

When we invoke repaint() for a java.awt.Component object, the AWT invokes the method:

  draw()

  show()

  paint()

  update()

  Half-n-half Clue
 

4.

Which of the following methods can be used to remove a java.awt.Component object from the display?

  remove()

  disappear()

  move()

  delete()

  hide()

  Half-n-half Clue
 

5.

DataInput is

  an interface that defines methods to read primitive data types.

  an interface that defines methods to open files.

  a class we can use to read primitive data types.

  an abstract class defined in java.io.

  Half-n-half Clue
 

6.

Which exception is thrown by the read() method of InputStream class?

  IOException

  FileNotFoundException

  None of these

  ReadException

  Exception

  Half-n-half Clue
 

7.

Which of the following statements are true?
(A) Unicode characters are all 16 bits.
(B) UTF characters are all 24 bits.
(C) Reader class has methods that can read integers and floats.
(D) File class may be used to rename a file.
(E) DataOutputStream objects are used to write primitive data to a file.

  (A) & (D)

  (B), (D) & (E)

  (A), (D) & (E)

  (A), (C), (D) & (E)

  (A), (B) & (D)

  Half-n-half Clue
 


 
12 more pages in Java Programming


Contact Info © 1999-2025 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright
Previous
-
Next
-