method burnGas in class GasTank cannot be applied to given types;
required: double, double
found: no arguments
reason: actual and formal argument lists differ in length
The operator that you use here cannot be used for the
type of value that you are using it for. You are either
using the wrong type here, or the wrong operator.
fred rosenberger wrote:the compiler is telling you the problem. You have defined the burnGas method to take two parameters:
You have to tell it how far you are driving, and what the MPG is so it can compute how much gas is needed. But on line 81, you call burnGas with no parameters:
Java is telling you that there is no such method called burnGas that takes no parameters.
Alex Petsche wrote:Just a thought, but if I'm right could it be that it's not running correctly because there isn't a "main" method?
Alex Petsche wrote:Ah ok. Thanks for clearing that up. Just to make sure I've got it straight a compile error is when the code logic doesn't follow through and a run error means that the code logic is correct, but the output isn't what you wanted? I guess I'm not sure what the difference is otherwise.
Yes, the first three words you posted told us that. At least those of us who have suffered from BlueJ ourselves.
Michelle Purdy wrote:We use BlueJ . . .
…and get a full list of compiler errors.
javac Car.java GasTank.java
That is unfair. Maligning the compiler like that, Fred!
fred rosenberger wrote:. . . But remember, the compiler is dumb. . . .
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database