Why am I getting no such constructor when it is defined in my class?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpuser123
    New Member
    • Dec 2009
    • 108

    Why am I getting no such constructor when it is defined in my class?

    I just happened to learb about interfaces. It drew me to implement this little code.
    But I am getting some error when I a m instatiating a video object in my videoclub class, there is some error stating no such constructor defined although it hs been defined .

    Why am getting such an error?

    Code:
    public class intf {
    public static void main(String[] args){
    	System.out.println("Hello world");
    }
    }
    interface VideoClub{
    	String ba="VideoPradise";
    	int area=100;
    	public static video[][] cat=new video[5][5];
    	public static int num_videos=0;
    	
    	public void addvideo(String name,int quantity,float price);
    	public void deletevideo(String name,int quantity);
    	public void updatevideo(String name,int quantity,float price);
    	
    }
    interface Video{
    
    	
    	
    }
    
    class videoclub implements VideoClub{
    	public void addvideo(String name,int quantity,float price){
    		 VideoClub.cat[0][0]=new video(name);
    	}
    	public void deletevideo(String name,int quantity){
    		
    	}
    	public void updatevideo(String name,int quantity,float price){
    		
    	}
    }
    class video implements Video{
    	public String name;
    	public int qtn;public float price;
    	public void video(String name){
    		this.name=name;
    		
    	}
    	
    }
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    You're missing a videoclub and video constructors, eg
    videoclub(){}

    video(){}

    Comment

    Working...