Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
Method Invocation Expressions

Java Language Specification, Version Java SE 21 Edition
15.12. Method Invocation Expressions

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.12

14 Documented Misconceptions

Misconception
CallNotStaticallyChecked
A method invocation on a reference of a type that does not have that method won't compile
Misconception
CallOnPrimitive
One can invoke a method on primitive values
Misconception
CallRequiresVariable
One needs a variable to invoke a method
Misconception
CannotChainMemberAccesses
Member accesses cannot be chained together
Misconception
CannotChainMemberToConstructor
Method calls or field accesses cannot be chained to a constructor invocation
Misconception
ChainedMethodsNotCalledFromOutside
Chained methods are all called on the object at the beginning of the chain
Misconception
LiteralString
When passing a literal string as argument to a method, no quotes are needed
Misconception
NoCallOnStringLiteral
One cannot invoke methods on String literals
Misconception
OutsideInMethodNesting
Nested method calls are invoked outside in
Misconception
ParenthesesOnlyIfArgument
() are optional for method calls without arguments
Misconception
RightToLeftChaining
Chained accesses are invoked from right to left
Misconception
StaticDispatch
The method to be called is determined by the static type
Misconception
StaticCallPolymorphic
A static method call is dispatched polymorphically at runtime based on the argument types
Misconception
SuperAlwaysHasParentheses
To call a method on a superclass, parentheses are needed after the keyword super

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors