300+ câu trắc nghiệm Lập trình mạng có đáp án - Phần 11

Cho biết số byte mà đoạn chương trình sau ghi ra tập tin temp. txt

12/25

Cho biết số byte mà đoạn chương trình sau ghi ra tập tin temp. txtimport java.io. * ;
public class TestIOApp {
public static void main(String args[]) throws IOException {
FileOutputStream outStream = new FileOutputStream("temp.txt");
String s = "test";
for (int i = 0; i
outStream.write(s.charAt(i));
outStream.close();
}
}

2 bytes

4 bytes.

8 bytes

16 bytes

Giải thích

Chọn đáp án B