2.7.1. ObjUse-WE6-P1

Subgoals for Calling a Method

  1. Classify method as static method or instance method

    1. If static, use the class name

    2. If instance, must have or create an instance

  2. Write (instance / class) dot method name and ( )

  3. Determine whether parameter(s) are appropriate

    1. Number of parameters passed must match method declaration

    2. Data types of parameters passed must match method declaration (or be assignable)

  4. Determine what the method will return (if anything: data type, void, print, change state of object) and where it will be stored (nowhere, somewhere)

  5. Evaluate right hand side (RHS) of assignment (if there is one). Value is dependent on method’s purpose


ObjUse-WE6-P1

For the following questions, fill in the blanks with NO spaces.

For example, use Math.pow(x,y) rather than Math.pow(x, y)

You have attempted of activities on this page