milind milind - 2 months ago 11
Java Question

how to use nested class in another class in java?

I have some situation that I want to use inner class of another class in another class.
like...

public class ListData {
public static class MyData {

public String textSongName, textArtistName, textDuration, textDownloadPath,
textSongSize, textAlbumName, textUrl;
public boolean enable;

public MyData(String songName, String artistName, String duration,
String downloadPath, String songSize, String albumName,
String url, boolean e) {
textSongName = songName;
textArtistName = artistName;
textDuration = duration;
textDownloadPath = downloadPath;
textSongSize = songSize;
textAlbumName = albumName;
textUrl = url;
enable = e;
}
}

}


now I want to use Mydata class in another.

how can I do this?

Thanks.

Answer
ListData.MyData myData = new ListData.MyData();