yvescorvilain
Legacy Member
Beste Forumleden,
Bij het leren van Java in BlueJ stuit ik op het volgende probleem:
Ik maak een databank waarin allerlei multimedia objecten kunnen opgeslagen worden.
overerving is als volgt
Item -> Game -> Videogame
de code van de superclass Item is als volgt:
Daarop volgt de subclass Game, tot hier alles inorde
en bij het declareren van een nieuwe class Videogame loopt het fout.
Ik krijg de error: "Cannot find symbol - constructor Game (string, string)
Wat loopt er mis?
Bedankt,
Bij het leren van Java in BlueJ stuit ik op het volgende probleem:
Ik maak een databank waarin allerlei multimedia objecten kunnen opgeslagen worden.
overerving is als volgt
Item -> Game -> Videogame
de code van de superclass Item is als volgt:
HTML:
public class Item
{
private String title;
private int playingTime;
private boolean gotIt;
private String comment;
public Item(String theTitle, int time)
{
title = theTitle;
playingTime = time;
gotIt = false;
comment = "";
}
public void setComment(String comment)
{
this.comment = comment;
}
public String getComment()
{
return comment;
}
public void setOwn(boolean ownIt)
{
gotIt = ownIt;
}
public boolean getOwn()
{
return gotIt;
}
public void print()
{
System.out.print("title: " + title + " (" + playingTime + " mins)");
if(gotIt) {
System.out.println("*");
} else {
System.out.println();
}
System.out.println(" " + comment);
}
}
Daarop volgt de subclass Game, tot hier alles inorde
HTML:
public class Game extends Item
{
private String developer;
private String players;
public Game(String theTitle, String theDeveloper, String thePlayers, int time)
{
super(theTitle, time);
developer = theDeveloper;
players = thePlayers;
}
public String getDeveloper()
{
return developer;
}
public String getNumberofPlayers()
{
return players;
}
}
en bij het declareren van een nieuwe class Videogame loopt het fout.
Ik krijg de error: "Cannot find symbol - constructor Game (string, string)
HTML:
public class Videogame extends Game
{
private String platform;
public Videogame(String theTitle, String theDeveloper, String thePlayers, String whatPlatform, int time)
{ super(theDeveloper, thePlayers);
platform = whatPlatform;
}
public String getPlatform()
{
return platform;
}
}
Wat loopt er mis?
Bedankt,


