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.

If you want to assign a value of 99 to the variable year, then which of the following lines can be used within an tag?

  < number = 99 >

  < param number = 99 >

  < param name = number value = 99 >

  < param = radius value = 99 >

  number = getParameter(99)

  Half-n-half Clue
 

2.

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

  (A), (D) & (E)

  (B), (D) & (E)

  (A) & (D)

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

  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);

  (B) & (C)

  (B), (C) & (E)

  (B), (D) & (E)

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

  (B), (C) & (D)

  Half-n-half Clue
 

4.

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

  paint()

  show()

  draw()

  update()

  Half-n-half Clue
 

5.

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()

  (B) & (E)

  (D) & (E)

  (B), (D) & (E)

  (A), (B) & (E)

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

  Half-n-half Clue
 

6.

What does the following line of code do?
Textfield text = new Textfield(10);

  Creates text object that can hold 10 columns of text.

  Creates the object text and initializes it with the value 10.

  Creates text object that can hold 10 rows of text.

  The code is illegal.

  Half-n-half Clue
 

7.

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

  move()

  hide()

  delete()

  remove()

  disappear()

  Half-n-half Clue
 


 
12 more pages in Java Programming


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