Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
The return Statement

Java Language Specification, Version Java SE 21 Edition
14.17. The return Statement

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.17

5 Documented Misconceptions

Misconception
ConstructorReturnsObject
Constructors need to return objects
Misconception
DeferredReturn
A return statement in the middle of a method doesn't return immediately
Misconception
RecursiveCallSiteNoReturn
Tail-recursive call sites of non-void methods need no return statement
Misconception
ReturnCall
Return statements need () around the return value
Misconception
ReturnUnwindsMultipleFrames
A return statement can unwind multiple call stack frames

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors