milind milind - 1 year ago 92
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?


Answer Source
ListData.MyData myData = new ListData.MyData();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download