Menu

Java Write Command Line Program Accepts Folder Name Command Line Prints Tree Folders Files Q43860472

JAVA:

Write a command-line program that accepts a folder name on thecommand line, and prints the tree of folders and files belowit.

Hints:

  • To get the list of files and folders in a particular folder,use File.listFiles() and File.isDirectory()
  • To get the argument from the command line, read the mainmethod’s parameter (String[] args)
  • Pass the current level as a parameter, and indent eachfile/folder appropriately

Turn in the following,

  • The source files
  • A screen shot of your program in action

Expert Answer


Answer to JAVA: Write a command-line program that accepts a folder name on the command line, and prints the tree of folders and fi…

OR