What is an implicit argument in java?

1 answer

Answer

1062783

2026-07-11 16:16

+ Follow

Java
Java

Two implicit arguments are passed into any Java method which is not declared "static". They are referenced using the keyWords "this" and "super."

"this" refers to the object instance on which the method was called. For example, in the line of code:

int len = "abcde".length();

Even though String.length() takes no arguments, a reference to a String instance containing "abcde" is passed to length() through the keyWord "this." A possible implementation of String.length() could then be:

public int length() {

return this.chars.length;

}

However, in most cases, it is not necessary to explicitly use "this."

The "super" keyWord points to the same object as "this" but is instead used to call a member of the object's superclass rather than of the object's concrete class.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.