![]() ![]() What that means is that this is a prime candidate for encapsulation into its own method. Redundancy: Any time you are copy-pasting code, alarm bells should go off in your head. Even just add() might work, though that might be a bit misleading and lead someone reading your code to believe that all the method does is add two numbers, when really the core functionality is user interface. So for example, your addition() method might be better named performAddition() or some such. Method names: Method names should always be verb phrases (actions) which describe what the method does.For example, I have no idea why you named your Scanner "kb". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |