2012-08-25 59 views
0

IM从下面的代码Java目录错误

package au.edu.uow.Collection; 

import java.util.ArrayList; 
import java.io.*; 

public class CollectionFactory{ 
     DVDAlbum dvd = new DVDAlbum(tempTitle,tempGenre, tempDirector, tempPlot); 
} 

收到以下错误

javac MyCollection.java ./au/edu/uow/Collection/CollectionFactory.java:109: 
cannot access au.edu.uow.Collection.DVDAlbum 
bad class file: ./au/edu/uow/Collection/DVDAlbum.java 
file does not contain class au.edu.uow.Collection.DVDAlbum 
Please remove or make sure it appears in the correct subdirectory of the classpath. 
        DVDAlbum dvd = new DVDAlbum(tempTitle,tempGenre, tempDirector, tempPlot); 

这是DVDAlbum实施

import au.edu.uow.Collection.Album; 

public class DVDAlbum implements Album{ 

    private String Title; 
    private String Genre; 
    private String Director; 
    private String Plot; 
    private String MediaType; 

    public DVDAlbum(String TempTitle, String TempGenre, String TempDirector, String TempPlot){ 
     Title = TempTitle; 
     Genre = TempGenre; 
     Director = TempDirector; 
     Plot = TempPlot; 
    } 
    String getMediaType(){ 
     return MediaType; 
    } 
    String getTitle(){ 
     return Title; 
    } 
    String getGenre(){ 
     return Genre; 
    } 
} 

任何帮助,将不胜感激

回答

1

您的DVDAlbum似乎没有任何包装声明。 Add:

package au.edu.uow.Collection; 
+0

非常感谢你,哈哈我应该知道 –