Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeTextbooks
Java
ofj6
Understanding class definitions

Objects-First with Java: A Practical Introduction using BlueJ, 6th Edition
2. Understanding class definitions

9 Documented Misconceptions

Check Yourself
Misconception
ComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to false
Misconception
ConditionalIsSequence
If-else is equivalent to sequence of two ifs
Misconception
ConstructorAllocates
The constructor allocates the object
Misconception
ConstructorReturnsObject
Constructors need to return objects
Misconception
DeferredReturn
A return statement in the middle of a method doesn't return immediately
Misconception
IfIsLoop
The body of an if statement executes repeatedly, as long as the condition holds
Misconception
OutsideInMethodNesting
Nested method calls are invoked outside in
Misconception
ReturnCall
Return statements need () around the return value
Misconception
StringLiteralNoObject
One needs to call the String constructor to get a String object from a literal

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors