У меня есть 2 класса, cPuzzlePieces
и cShapes
. cPuzzlePieces
распространяется cShapes
.Попытка сделать родительский класс
Сейчас я получаю 2 ошибки на cPuzzlePeaces
.
Первая ошибка находится на первой линии опр и говорит:
implacet super constructor cShapes is undefined for default constructor.
Вторая ошибка на первой линии construter говорит
constructor call must be the first staemnt
и находится на первом staement ,
Вот мой код:
public class cPuzzlePieces extends cShapes{ // first error message is here
int mAmountOfShapes;
Context InContext;
void cPuzzlePieces(Context MyContext) throws IOException
{
super(MyContext); // SECOND ERROR MESSAGE IS HERE
InContext=MyContext;
}
}
public class cShapes
{
cShape[] MyShapes;
public int mAmountOfShapes=0;
boolean AnimationRunning=false;
cShapes(Context InContext) throws IOException
{
}
...
...
}
Имена классов начинаются с прописной буквы. Убедитесь, что вы скопировали ошибки точно, без опечаток. –
Ваши имена классов не должны начинаться с строчной буквы 'c'. Они должны быть просто «PuzzlePieces» и «Shapes». – ashes999