This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If you can do something just once, why do it twice? Use "number A" to calulate "number B" and then decide where the code that does this calculation should go. If the calcualtion is simple, you could just forget even having a second variable. If for example B = (4 * A), you could just have A and (4*A).
hi Amy I think that the coding should be keep clear and sample, the method is used to hiding the coding,procedure calculation. So, I perfer to use method to do something,it is also the concept of the encapsulation. (Hope that I without explain wrong of the encapsulation ) HTH