Question
Create a new file named C:JavaChapter.13ThisIsATest.txt Then write a Java application that displays the files name, containing folder, size, and time of last modification. Must
Create a new file named C:\\Java\\Chapter.13\\ThisIsATest.txt
Then write a Java application that displays the files name, containing folder, size, and time of last modification.
Must use/finish the Java code below.
---------------------------------------------------------------------------------------------------------------------------
//Write application that displays files name contining foldr, size, time of last modification import java.nio.file.*; import java.nio.file.attribute.*; import java.io.IOException; public class FileStatistics { public static void main(String[] args) { Path file = Paths.get("C:\\Java\\Chapter.13\\ThisIsATest.txt"); try { // try block to declare count and then display path, file name and folder name p.604 // declare a BasicFileAttributes object, then add statements to display the file's size and creation time } // catch block that catches potenial IOException thrown catch(IOException e) { // add display IOException } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started