Please enable JavaScript to use CodeHS

Chapter 2

Using Objects

2.4 Calling a Void Method with Parameters

Parameters

Defining a Method with Parameters

Calling a Method with Parameters

Pass By Value

Multiple Parameters

Why Use Parameters?

Parameter Order

Calculator

Method Overload

Moving a Point

Rectangle

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: More Operations

Vocabulary

Term Definition
Method overloading Methods can have multiple signatures. Java will use the correct signature based on the actual parameters used in a program.