Methods Flashcards
What does the static keyword do?
It allows a method to be called on its own, not as a part of an object.
Makes it standalone.
What does the void keyword do?
defines a method’s return value as null (doesnt have a return value)
What is variable scope?
A variable scope is the portion of the program code that that variable is
visible within.
What do you have to do to make a method accept arguments?
Define it’s parameters.
In the parens next to the method signature, you declare the parameter type and name.
static void Subtract(double first, double second)
What is a method parameter?
A parameter is a special variable that you declare at the start of a method. It is one of multiple arguments that you are allowing callers to pass through the method.