Parts of a Header
Visibility Modifier
(hover to flip)
Visibility Modifier
Sets visibility of method. Can be public
or private
.
public
means method can be accessed from outside class.
Return Data Type
Return Data Type
Specifies the data type returned by the method.
return
statement is required (except for void
) and data type returned must match.
Method Name
Method Name
Name of method
Must follow naming rules. Parentheses are required and may contain a list of parameters.
Parameters
Parameters
List of parameters (if any) and their data types.
The name of each parameter is called a formal parameter.
public int areaSquare(int side)