Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

First things first, you can compare your solution with some of the other calculator implementations in Java calculator implementations in Java on this site. :)

First things first, you can compare your solution with some of the other calculator implementations in Java on this site. :)

First things first, you can compare your solution with some of the other calculator implementations in Java on this site. :)

replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

The usual approach for this kind of functionality is to re-think how your arithmetic methods take in two inputs to give you an output. Setting aside the float-or-double question float-or-double question, you should consider having methods like this:

The one thing that strikes out as odd to me in your code is the heavy reliance on static fields and methods with void return types. This indicates that while you seem to think you need inheritance here (when you don't, see above section), you have forgotten about how to make effective use of class methods to pass information around explicitly, instead choosing to rely on a global state global state.

The usual approach for this kind of functionality is to re-think how your arithmetic methods take in two inputs to give you an output. Setting aside the float-or-double question, you should consider having methods like this:

The one thing that strikes out as odd to me in your code is the heavy reliance on static fields and methods with void return types. This indicates that while you seem to think you need inheritance here (when you don't, see above section), you have forgotten about how to make effective use of class methods to pass information around explicitly, instead choosing to rely on a global state.

The usual approach for this kind of functionality is to re-think how your arithmetic methods take in two inputs to give you an output. Setting aside the float-or-double question, you should consider having methods like this:

The one thing that strikes out as odd to me in your code is the heavy reliance on static fields and methods with void return types. This indicates that while you seem to think you need inheritance here (when you don't, see above section), you have forgotten about how to make effective use of class methods to pass information around explicitly, instead choosing to rely on a global state.

fixed spelling typos.
Source Link
h.j.k.
  • 19.3k
  • 3
  • 37
  • 93

You have a weird way of iterating through methods. Instead of using loop structures, you have your methods repeatedly calling each other at the end as such (// Here... // And Herehere.):

Putting it togetheraltogether

You have a weird way of iterating through methods. Instead of using loop structures, you have your methods repeatedly calling each other at the end as such (// Here... // And Here.):

Putting it together

You have a weird way of iterating through methods. Instead of using loop structures, you have your methods repeatedly calling each other at the end as such (// Here... // And here.):

Putting it altogether

fixed typo.
Source Link
h.j.k.
  • 19.3k
  • 3
  • 37
  • 93
Loading
deleted 1 character in body
Source Link
h.j.k.
  • 19.3k
  • 3
  • 37
  • 93
Loading
Source Link
h.j.k.
  • 19.3k
  • 3
  • 37
  • 93
Loading
lang-java

AltStyle によって変換されたページ (->オリジナル) /