MODULE (4) Week 5 - Methods, Arrays, Arrays as Objects Flashcards
A program module. It contains a series of statements and carries out a task
Method
Executing a method
Invoke or call from another method
Makes a method call
Calling method (client method)
Invoked by a calling method
main() method executes automatically
Called method
A method must include:
A method header (declaration)
A method body (implementation)
The method header contains:
Optional access specifiers
A return type
An identifier
Parentheses that might contain data to be sent to the method
Access specifier that allows use by any other class and is the most commonly used by methods
public access specifier
Describes the type of data the method sends back to the calling method
Return type
What is the return value of a method of no data is returned to the method?
void
Requirements for a method name
Must be one word
No embedded spaces
Cannot be a Java keyword
The part of a method heather that may contain data to be sent to the method
Parenthesis
Data items you use in a call to a method
Data items received by the method
Parameters
The only part of a method that
the client sees or with which it
interacts
Interface