Java: KIỂM TRA KIẾN THỨC JAVA IO

Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực

QUESTIONS

1. Which of the following are true about stream classes?

(A)

They help read input from a stream.

(B)

Input and Output streams are used for reading and writing of structured sequence of bytes.

(C)

They help manage disk files.

(D)

All classes that work on streams directly works with files and the file system.

Choose answer:

(A)

A, C

(C)

C

(B)

B

(D)

D

2. The File(String dirpath) constructor______________________________________ _.

(A)

Creates a File object with pathname of the file specified by the String variable dirpath into an abstract pathname.

(B)

Creates a File object with pathname of the file specified by the String variables parent and child.

(C)

Creates a new File instance from another File object specified by the variable fileObj.

(D)

Converts the given file: URI into an abstract pathname and creates a new File

instance.

Choose answer:

(A)

A

(C)

C

(B)

B

(D)

D

3. Which of the following classes create a FileInputStream or FileOutputStream to contain it?

(A)

System

(B)

File

(C)

FileDescriptor

(D)

FilenameFilter

Choose answer:

(A)

A

(C)

C

(B)

B

(D)

D

4. The sync method__________________ _.

(A)

Creates an (invalid) FileDescriptor object

(B)

Checks whether the file descriptor is valid

(C)

Reads bytes from a binary stream

(D)

Clears the system buffers and writes the content that they contain to the actual hardware

Choose answer:

(A)

A

(C)

C

(B)

B

(D)

D

5. Identify the methods in the DataInput interface.

(A)

delete()

(B)

renameTo()

(C)

toPath()

(D)

readBoolean()

Choose answer:

(A)

A

(C)

C

(B)

B

(D)

D

6. What is the process of saving data to some permanent storage called?

(A)

Serialization

(B)

Persistence

(C)

Deserialization

(D)

Append mode

Choose answer:

(A)

A

(C)

C

(B)

B

(D)

D

Answers

1.

A

2.

A

3.

C

4.

D

5.

D

6.

B

» Tiếp: Câu hỏi và bài tập phần java.io file
« Trước: Java DOM Parser - Đọc, tạo, sửa tài liệu XML
Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực
Copied !!!