After the following program is finished, how many bytes are written to the file t.dat?
```
import java.io.*;
public class Test {
public static void main(String[] args) throws IOException {
DataOutputStream output = new DataOutputStream(
new FileOutputStream("t.dat"));
output.writeUTFString("ABCD");
output.close();
}
}
```
a. 2 bytes.
b. 4 bytes.
c. 6 bytes.
d. 8 bytes.
e. 10 bytes.
c. 6 bytes.
"ABCD" are ASCII code, so each takes one byte in UTF. Total is 6 because the first two bytes stores the number of characters in the string.
You might also like to view...
Which of the following stream manipulators causes an outputted number’s sign to be left justified, its magnitude to be right justified and the center space to be filled with fill characters?
a. left b. right c. internal d. showpos
You can view the contents of the ________ Clipboard by opening the Clipboard pane
Fill in the blank(s) with correct word
For older browsers that do not support media queries, Cascading Style Sheets (CSS) 3 provides the _____ keyword to hide style sheets from those browsers.?
A. ?initial B. ?none C. ?only D. ?auto
Which of the following settings needs to be adjusted inside of a WAP to provide a network to a wireless device?
A. SSID B. WPA C. WEP D. DHCP