list() method is used to get listing of the directory pointed by file class object when
Answers
Answered by
0
Answer:
1. Create File object for main directory.
2. Get array of files for main directory.
3. If array[i] is a file :
-> Print out file name.
4. If array[i] is a directory :
-> Print out directory name.
-> Get array of files for current sub-directory.
-> Repeat the step 3 and 4 with current sub-directory.
5. Repeat the step 3 and 4 with next array
Similar questions