Section 4.13 ObjUse-WE6-P1
Subgoals for Calling a Method.
-
Classify method as
static
method orinstance
method- If
static
, use the class name - If
instance
, must have or create an instance
- Write (instance / class) dot method name and ( )
-
Determine whether parameter(s) are appropriate
- Number of parameters passed must match method declaration
- Data types of parameters passed must be compatible with method declaration
- Determine what the method will return and where it will be stored
- Evaluate right hand side of assignment. Value is dependent on method’s purpose
Subsection 4.13.1
Here are some of the common
Math
methods, which are all static.
Subsection 4.13.2
For the following questions, fill in the blanks with NO spaces.
Exercises Exercises
2.
3.
You have attempted 1 of 3 activities on this page.