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.

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

  update()

  show()

  paint()

  draw()

  Half-n-half Clue
 

2.

Which of the following methods can be used to draw the outline of a square within a java.awt.Component object?
(A) fillRect()
(B) drawLine()
(C) drawRect()
(D) drawString()
(E) drawPolygon()

  (B) & (C)

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

  (C), (D) & (E)

  (B), (C) & (E)

  (A), (B) & (C)

  Half-n-half Clue
 

3.

Given file is a File object, which of the following are legal statements to create a new file?
(A) file.create();
(B) FileOutputStream fos = new FileOutputStream(file);
(C) FileWrter out = new FileWriter(file);
(D) FileInputStream fis = new FileInputStream(file);
(E) RandomAccessFile raf = new RandomAccessFile(file);

  (A), (B), (D) & (E)

  (B), (D) & (E)

  (B) & (C)

  (B), (C) & (E)

  (B), (C) & (D)

  Half-n-half Clue
 

4.

Which of the following methods can be used to change the size of a java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()

  (D) & (E)

  (B) & (E)

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

  (A), (B) & (E)

  (B), (D) & (E)

  Half-n-half Clue
 

5.

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

  remove()

  delete()

  disappear()

  move()

  hide()

  Half-n-half Clue
 

6.

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

  Applet

  Component

  Object

  Container

  Graphics

  Half-n-half Clue
 

7.

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), (B), (C) & (E)

  (C) & (D)

  (A), (B) & (C)

  (A) & (C)

  (B), (D) & (E)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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