350 Câu hỏi trắc nghiệm môn Lập trình mạng có đáp án - Phần 5

Cho biết số byte mà đoạn chương trình sau ghi ra tập tin temp. txt import java.io. * ; public class TestIOApp { public static void main(String args[]) throws IOException { FileOutputStream ou

12/50

Cho biết số byte mà đoạn chương trình sau ghi ra tập tin temp. txt
import 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

B là đáp án đúng