Skip to main content
- A method is code block that contains a set of programming statements.
- Also called a function
- Purpose: To implement the logic required for specific behaviour or functionality in a class.
- Identify the problem that method should solve. will this method calculate and return a value?
- Ensure the method has a single purpose. clarifying the purpose will help determine which class the method belongs to.
- Specify the inputs and the outputs, what data the method need? what data should the method return?
- State any assumptions. Does the incoming data need to be within a range of value or date after the current date? Whatever the assumptions are, state them.
- Consider the errors that could occur.
Comments
Post a Comment