gs gs128 Java Autoboxing - File and Directory in Java - Quiz No.1
gs gs128 Java Quiz
This quiz belongs to book/course code gs gs128 Java of gs organization. We have 136 quizzes available related to the book/course Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Java Autoboxing. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: Which method is used to create a directory with fileattributes?
Path.create()
Path.createDirectory()
Files.createDirectory(path, fileAttributes)
Files.create(fileAttributes)
Question 2: Which method can be used to check fileAccessiblity?
isReadable(path)
isWritable(path)
isExecutable(path)
isReadable(path), isWritable(path), and isExecutable(path)
Question 3: How can we delete all files in a directory?
Files.delete(path)
Files.deleteDir()
Directory.delete()
Directory.delete(path)
Question 4: How to copy the file from one location to other?
Files.copy(source, target)
Path.copy(source, target)
source.copy(target)
Files.createCopy(target)
Question 5: How can we get the size of specified file?
capacity(path)
size(path)
length(path)
Path.size()
Question 6: How to read entire file in one line using java 8?
Files.readAllLines()
Files.read()
Files.readFile()
Files.lines()
Question 7: How can we create a symbolic link to file?
createLink()
createSymLink()
createSymbolicLink()
createTempLink()
Question 8: How can we filter lines based on content?
lines.filter()
filter(lines)
lines.contains(filter)
lines.select()
Question 9: Which jar provides FileUtils which contains methods for file operations?
file
apache commons
file commons
dir
Question 10: Which feature of java 7 allows to not explicitly close IO resource?
try catch finally
IOException
AutoCloseable
Streams