It would be a good habit to start avoiding floating point data types (like float and double) to represent monetary values, because those values will always need to be exact and floating point data types just don't offer that accuracy. Use BigDecimal instead, or possibly even int or long if the situation allows for it. Also, are you worried at all about Object Orientation at this point or are you just familiarizing yourself with the basics of Java?
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
posted 6 years ago
i'm taking a class on java, so i'm just learning the basics.