milind milind - 1 month ago 4x
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.

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?


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