JavaScript is required

Cho biết các tạo ra một thể hiện của InputStreamReader từ một thể hiện của InputStream

A.

Sử dụng phương thức createReader() của lớp InputStream

B.

Sử dụng phương thức createReader() của lớp InputStreamReader

C.

Tạo một thể hiện của InputStream rồi truyền vào cho hàm khởi tạo của InputStreamReader

D.

Tất cả các câu trên đều sai

Trả lời:

Đáp án đúng: C


Để tạo một thể hiện của `InputStreamReader` từ một thể hiện của `InputStream`, bạn cần sử dụng hàm khởi tạo (constructor) của lớp `InputStreamReader` và truyền thể hiện `InputStream` vào đó. Ví dụ: `InputStreamReader reader = new InputStreamReader(inputStream);`

Câu hỏi liên quan