1. Computing
Send to a Friend via Email

Implicit Parameter

By

Definition:

When calling a method of an object it's common to pass a value to the method. For example, if the object Employee has a method called setJobTitle:

 Employee dave = new Employee();
 dave.setJobTitle("Candlestick Maker"); 

the String "Candlestick Maker" is an explicit parameter being passed to the setJobTitle method. However, there is another parameter in the method call that is known as the implicit parameter. The implicit parameter is the object the method belongs to. In the above example it's dave, the object of type employee.

Implicit parameters are not defined within a method declaration because they are implied by the class the method is in:

 public class Employee {
 
   public void setJobTitle(String jobTitle)
   {
     this.jobTitle = jobTitle;
   }
 } 

In order to call the setJobTitle method there must be an object of type Employee.

Glossary:

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

  1. About.com
  2. Computing
  3. Java
  4. Java Glossary
  5. I
  6. Definition for the Term: Implicit Parameter

©2014 About.com. All rights reserved.