15.11 Method Invocation Expressions

A method invocation expression is used to invoke a class or instance method.

MethodInvocation:
MethodName ( ArgumentListopt )
Primary . Identifier ( ArgumentListopt )
super .
Identifier ( ArgumentListopt )

The definition of ArgumentList from §15.8 is repeated here for convenience:

ArgumentList:
Expression
ArgumentList , Expression

Resolving a method name at compile time is more complicated than resolving a field name because of the possibility of method overloading. Invoking a method at run time is also more complicated than accessing a field because of the possibility of instance method overriding.

Determining the method that will be invoked by a method invocation expression involves several steps. The following three sections describe the compile-time processing of a method invocation; the determination of the type of the method invocation expression is described in §15.11.3.