초보자가 자바 숙제를하고 있습니다. ,자바 : 기호 (생성자)를 찾을 수 없습니다.
public static void main (String[] args) {...
Album album1 = new Album("Debut", "Venus as a Boy", 3);
Album album2 = new Album("Homework", "Around the World", 7);
Album album3 = new Album("Ghost in the Machine", "Invisible Sun", 3);
...}
그러나 ...
public class Album {
private String title;
private String artist;
private String genre;
private Song favoriteTrack;
private int trackNumber;
private static int numAlbums;
//Constructors
public Album(String title, Song favoriteTrack, int trackNumber) {
this.title = title;
this.favoriteTrack = favoriteTrack;
this.trackNumber = trackNumber;
artist = favoriteTrack.getArtist();
genre = favoriteTrack.getGenre();
numAlbums++;
}
public Album(String title, Song favoriteTrack) {
this(title, favoriteTrack, 1);
}
...}
그리고 나는 그것의 주요 방법에서, 세 번 앨범 클래스의 인스턴스를 두 번째 클래스 MusicCollection이 : 나는 다음과 같은 생성자를 포함 앨범이라는 하나 개의 클래스가 내가 생성자를 호출 할 때마다
cannot find symbol
symbol : constructor Album(java.lang.String,java.lang.String,int)
location : class Album
: 나는 MusicCollection.java를 컴파일 할 때, 나는 오류가 발생합니다. Album 클래스와 MusicCollection 클래스가 같은 디렉토리에 있고 Album.java가 컴파일됩니다. 나는 어리석은 짓을하고 있다고 상상하지만이 사실을 알 수는 없다. 도움이 될 것입니다.
숙제 도움말을 요청해도 숙제 태그를 포함해야합니다. – Jivings
좋아, 나는 그걸 기억할 것이다. – kirky