Каждый знает, что значит эта ошибка:Методы и обратные задачи
RectangleArea.java:21: error: method getLength in class RectangleArea cannot be applied to given types;
length = getLength();
^
required: double,Scanner
found: no arguments
reason: actual and formal argument lists differ in length
import java.util.Scanner;
public class RectangleArea
{
public static void main (String [] args)
{
Scanner keyboard = new Scanner (System.in);
double length, // The rectangle's length
width, // The rectangle's width\
area; // The rectangle's area
welcomeBanner();
// Get the rectangle's length from the user.
length = getLength();
}
static void getLength(double aLength, Scanner aKeyboard)
{
System.out.print("Enter the rectangle's length: ");
aLength = aKeyboard.nextDouble();
System.out.println("");
return aLength;
}
}
Как я могу это исправить?
Хорошо посмотрите на параметры 'getLength' ... затем посмотрите на аргументы, которые вы передаете (нет) ... –
вы можете объяснить аргументы? Я как бы потерял там –
Какова цель 'getLength (...)'? Он возвращает значение, которое вы хотите ввести. – Ceelos