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?
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;
}
}
Comment