在我的 CD 类和 TrackList 类中,我有一个名为 tracklist 的对象,它作为错误出现。我不知道我需要添加或删除什么来修复它。这是我的CD课:
public class CD {
public String artist;
public String title;
public trackist myTracklist;
public CD(String artist, String title){
artist = artist;
title = title;
myTracklist = new tracklist(100);
}
public static void main(String[] args) {
String mainArtist;
String mainTitle;
CD myCD = new CD("RisingNation", "Natioins");
mainArtist = myCD.getArtist();
System.out.println(mainArtist);
mainTitle = myCD.getTitle();
System.out.println(mainTitle);
myCD.display();
}
public String getArtist(){
String person;
person = artist;
return person;
}
}
这也是我的曲目列表课程,
public class TrackList {
int length;
int numUsed;
String[] storage;
public tracklist(int size){// this shows up underlined in red
length = size;
numUsed = 0;
storage = new String[length];
}
public int count(){
return numUsed;
}
}