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.writeShort(1234);
output.writeShort(5678);
output.close();
}
}```
a. 2 bytes.
b. 4 bytes.
c. 8 bytes.
d. 16 bytes.
b Each short number takes 2 bytes. So total is 4 bytes.
You might also like to view...
A user's iPhone will not power on. Which of the following should the technician do FIRST to isolate the problem?
A. Plug the phone into a known good charger B. Remove and reseat the battery C. Replace the screen glass assembly D. Replace the battery and charge the phone
When the values of two variables are affected in a function, the function cannot be written as a call by value function.
Answer the following statement true (T) or false (F)