Home > Java Programming > Quizzes > Java Basics Practice Test: File and Directory
Java Basics Practice Test: File and Directory
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 0% Most missed: “How can we get the size of specified file?”
In Java, a file is a collection of data that is stored on a file system. A file can be a text file, image file, or binary file. A file has a name and an extension that identifies the type of data stored in the file. To create a file in Java, you can use the File class. The File class provides methods for creating, reading, writing to, and deleting files. A directory is a different type of object in the file system. A directory is a container that can hold files and other directories. A directory has a name and can be located on a file system. To create a directory in Java, you can use the... Show more
Java Basics Practice Test: File and Directory
Time left 00:00
10 Questions

1. Which method can be used to check fileAccessiblity?
2. Which method is used to create a directory with fileattributes?
3. How to read entire file in one line using java 8?
4. How can we create a symbolic link to file?
5. How can we filter lines based on content?
6. Which jar provides FileUtils which contains methods for file operations?
7. How can we get the size of specified file?
8. Which feature of java 7 allows to not explicitly close IO resource?
9. How can we delete all files in a directory?
10. How to copy the file from one location to other?