Please enable JavaScript to use CodeHS

Chapter 2

Using Objects

2.5 Calling a Non-void Method

Returning Results

Calling a Method With a Return Value

Multiple Parameters With a Return Value

Rectangle

Desks in a Room

Activity Log

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Laundry Costs

Vocabulary

Term Definition
return keyword Used to return a value back to the main program from a method.
Scope Defines which part of the program a variable can be accessed from.