Methods Flashcards
Method
A function or procedure that is associated with a class
The keyword used when a method does not return a value
void
Another word for object
Instance
What must be done first to use an object method?
Create an object of that class first. (ex. Scanner)
Static method
Class method
The syntax for calling a static method
ClassName.methodName()
The syntax for a method header
1) modifier
2) returnValueType
3) methodName
4) parameter list
Is the modifier required in a method header?
No, it is optional
public, private, public, static are all examples of:
Method modifiers
The keyword used if a method is not void.
return
Which data types “pass by value”
Primitive
Pass by Value
The arguments passed to the method are COPIES of the original
Objects (like String) are passed to a method with:
Pass by Reference
Method Signature
methodName (parameter list)
Making multiple methods of the same name, but with differing parameters
Method Overloading