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
public class File { private String name; public File(String name) { this.name = name; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
