Implicit Parameter

The implicit parameter of a method is the object on which the method is invoked

public void deposit(double amount)

{

     balance = balance + amount;

  }

In the call

momsSavings.deposit(500)

The implicit parameter is momsSavings and the explicit parameter is 500

 

When you refer to an instance variable inside a method, it means the instance variable of the implicit parameter

 

A method call without an implicit parameter is applied to the same object

Example:

public class BankAccount

{

   . . .

   public void monthlyFee()

   {

      withdraw(10); // Withdraw $10 from this account

   }

    }

The implicit parameter of the withdraw method is the (invisible) implicit parameter of the monthlyFee method

You can use the this reference to make the method easier to read

public class BankAccount

{

   . . .

   public void monthlyFee()

   {

      this.withdraw(10); // Withdraw $10 from this account

   }

    }