Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a file using any word-processing program or text editor. Write an application that displays the files name, containing folder, size, and time of

1. Create a file using any word-processing program or text editor. Write an application that displays the files name, containing folder, size, and time of last modification. Save the file as FileStatistics.java.

Below is a shell I have

1 import java.nio.file.*; 2 import java.nio.file.attribute.*; 3 import java.io.IOException; 4 public class FileStatistics 5 { 6 public static void main(String[] args) 7 { 8 Path file = 9 Paths.get("C:\\Java\\Chapter.13\\TestData.txt"); 10 try 11 { 12 // declare count and then display path, file name and folder name 13 14 15 16 // declare a BasicFileAttributes object, then add statements to display the file's size and creation time 17 18 } 19 20 catch(IOException e) 21 { 22 // add display IOException 23 24 } 25 }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

Whats involved in listening?

Answered: 1 week ago