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 = getParameter(99)

  < param name = number value = 99 >

  < param number = 99 >

  < param = radius value = 99 >

  < number = 99 >

  Half-n-half Clue
 

2.

DataInput is

  an interface that defines methods to read primitive data types.

  an interface that defines methods to open files.

  an abstract class defined in java.io.

  a class we can use to read primitive data types.

  Half-n-half Clue
 

3.

Which of the following applet tags is legal to embed an applet class named Test into a Web page?

  < applet
code = Test.class width = 200 height = 100>

  < applet>
code = Test.class width = 200 height = 100>

  < applet
param = Test.class width = 200 height = 100>

  < applet
class = Test width = 200 height = 100>

  < applet
code = Test.class width = 200 height = 100

  Half-n-half Clue
 

4.

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

  Creates text object that can hold 10 columns of text.

  Creates text object that can hold 10 rows of text.

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

  The code is illegal.

  Half-n-half Clue
 

5.

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)

  (A), (B) & (C)

  (A) & (C)

  (C) & (D)

  (B), (D) & (E)

  Half-n-half Clue
 

6.

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)

  (A), (D) & (E)

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

  (B), (D) & (E)

  Half-n-half Clue
 

7.

Which are the valid ways to create DataInputStream streams?

  new DataInputStream("in.dat", "r");

  new DataInputStream("in.dat")

  new DataInputStream(new FileInputStream("in.dat");

  new DataInputStream(new File("in.dat"));

  new DataInputStream();

  Half-n-half Clue
 


 
12 more pages in Java Programming


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