Question: You are required to implement the code and test code for numFiles() and numFolders() methods. The test code should be included in the fileTest1() method

You are required to implement the code and test code for numFiles() and numFolders() methods. The test code should be included in the fileTest1() method of the FileSystem class

When I run the jar file it should output :

size() method works

numFiles() method works

numFolders() method works

public class FileSystem { //private int numFiles; //private int numnumFolders; //private int size; //private ArrayList<>

public static void main(String[] args){

} public void filesTest(){ Folder folder = new Folder("Documents"); Folder music = new Folder("Music"); Folder photos = new Folder("Photos"); documents.add(photos); documents.add(music);

File file = new file("assign1.doc"); } }

public class Folder { private String name; private int numFiles; private int numnumFolders; private int size; private ArrayList folder = public Folder (String name){ this.name = name; } public boolean add(Folder folder){ return folders.add(folder); } public boolean File(File file){ return files.add(file); } }

public class File { private String name; public File(String name) { this.name = name; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!