i know this is a duplicate question of: list all files from directories and subdirectories in Java but i have a problem with displaying sub directories of a directory. I already have a folder class:
class Folder
{
bool isFile;
String folderName;
list<Folder> subFolders;
}
Now using this class i need to display the list of sub directories and files within a specified folder...
i tried using this code:
class FCheck
{
public static void main(String args[])
{
Folder obj=new Folder();
obj.folderName="C:\hello";
if(obj.folderName.isDirectory())
{
}
what should i do inside the if condition loop ?? i need to use the <list> folder subfolders
data!