Since I am not fluent in English (it is my fourth spoken language), I am thankful for any remarks about my grammar/sentences!
Best regards
Mike S
Yes. Get all that code out of the main() method. You aren't writing object‑oriented code. Where have you got a Calculator object, for example?Mike Savvy wrote:. . . . Would you suggest any improvements?
Eclipse makes suggestions, not instructions. That may be one of several suggestions for the same code. Many people use loggers for exception messages so they have the information in a file and can correct anything in the code. The stack trace would be incomprehensible to end‑users.. . . "Replace this use of System.out or System.err by a logger."
You have written continue; twice.. . . "Reduce the total number of break and continue statements . . ." . . .
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Mike Savvy wrote:...
(1) The problem is that Eclipse saying for example for every System.out "Replace this use of System.out or System.err by a logger."
Mike Savvy wrote:
(2) Then eclipse says that I never use Object "input" - but I think I use it every loop again, so where is the problem?
Eclipse gives you that warning, which I have seen many times, whenever you fail to close a Scanner or similar. You mustn't close a Scanner reading System.in, otherwise you close System.in. The correct option to pick is that with @SuppressWarnings....salvin francis wrote:. . . "Resource leak: 'input' is never closed". You can ignore this warning.
Mike Savvy wrote:Would you suggest any improvements?...
Since I am not fluent in English (it is my fourth spoken language), I am thankful for any remarks about my grammar/sentences!
Best regards
Mike S
Nonononononononono. Multiple methods are not there for readability but for reliability. We have already told you not to use the main method alone.Mike Savvy wrote:. . . I use only one method . . .
All things are lawful, but not all things are profitable.
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|