Вопрос №501 от пользователя Андрей Каменев в уроке «Модуль 3. Урок 5. Аннотация @Override в Java.», курс «Введение в Java»
Окончательно запутался в выполнении практики. Исправляю в одном месте, в другом новая ошибка вылетает... может кто со мной созвониться по скайпу и помочь разобраться?
А покажите ошибки, наверняка с ними кто-то уже сталкивался тут.
Ну это не отговорка :) Если хотите чему-то научится и получить помощь - вставляйте ошибки! Начните с первых 5-ти.
Чтобы не получилась каша – используйте форматирование: в редакторе есть кнопка 'code' (звездочка).
Подробнее про формат Markdown, который используется у нас в сообществе – https://ru.wikipedia.org/wiki/Markdown
их много, 18 штук когда вставляю каша получается. Ошибки все однотипные: constructor такой-то в таком-то классе cannot be applied to given types. + накопилось куча вопросов... почему тип final? что делает эта строка "private final Figure figure"? и т.д. и т.п. Так то суть урока по наследованию понятна, но вот написание кода ориентируясь на uml диаграмму не идет:(
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:21: error: constructor AdvConsoleView in class AdvConsoleView cannot be applied to given types;
final AdvConsoleView advConsoleView = new AdvConsoleView(gameController);
^
все равно не выходит нормально вставить
все, разобрался. надо было просто три апострофа поставить:)
javac io/hexlet/java/m101/xo/Main.java io/hexlet/java/m101/xo/model/Board.java io/hexlet/java/m101/xo/model/Figure.java io/hexlet/java/m101/xo/controller/GameController.java io/hexlet/java/m101/xo/view/AdvConsoleView.java io/hexlet/java/m101/xo/view/AdvConsoleView.java; java -ea io.hexlet.java.m101.xo.Main -cp .
io/hexlet/java/m101/xo/Main.java:20: error: constructor GameController in class GameController cannot be applied to given types;
final GameController gameController = new GameController("XO");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:21: error: constructor AdvConsoleView in class AdvConsoleView cannot be applied to given types;
final AdvConsoleView advConsoleView = new AdvConsoleView(gameController);
^
required: no arguments
found: GameController
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:22: error: constructor ConsoleView in class ConsoleView cannot be applied to given types;
final ConsoleView consoleView = new ConsoleView(gameController);
^
required: no arguments
found: GameController
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:29: error: constructor Figure in class Figure cannot be applied to given types;
final Figure figure = new Figure(figureName);
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:37: error: constructor Figure in class Figure cannot be applied to given types;
final Figure playerFigure = new Figure("A");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:38: error: constructor Player in class Player cannot be applied to given types;
final Player player = new Player(playerName, playerFigure);
^
required: no arguments
found: String,Figure
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/Main.java:50: error: constructor GameController in class GameController cannot be applied to given types;
final GameController gameController = new GameController(gameName);
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:6: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure11 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:8: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure12 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:10: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure13 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:12: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure21 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:14: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure22 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:16: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure23 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:18: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure31 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:20: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure32 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
io/hexlet/java/m101/xo/model/Board.java:22: error: constructor Figure in class Figure cannot be applied to given types;
private Figure figure33 = new Figure(" ");
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
16 errors
Error: Could not find or load main class io.hexlet.java.m101.xo.Main
Makefile:2: recipe for target 'test' failed
make: *** [test] Error 1 ```
Пожалуйста, покажите как у Вас реализован класс Figure. Судя по всему у Вас отсутствует конструктор класса Figuer. Мы немного упростили практику и теперь конструктор Figuer уже реализован.
Я до хекслета изучал яву по другим источникам и немного затронул конструкторы. По сему назначение понимаю.
public class Figure {
private String figure;
public String getFigure() {
return figure;
}
public void Figure(String figureName) {
figure = figureName;
}
}
текст программы выглядит верно. Что весьма странно, можно ли с Вами созвонится для уточнения деталей?
да, конечно) мой скайп: pvt_andrey
Используйте Хекслет по максимуму!
- Задавайте вопросы по уроку
- Проверяйте знания в квизах
- Проходите практику прямо в браузере
- Отслеживайте свой прогресс
Зарегистрируйтесь или войдите в свой аккаунт
С нуля до разработчика. Возвращаем деньги, если не удалось найти работу.







