Objects-First with Java: A Practical Introduction using BlueJ, 6th Edition
2. Understanding class definitions9 Documented Misconceptions
Check YourselfComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to falseConditionalIsSequence
If-else is equivalent to sequence of two ifsConstructorAllocates
The constructor allocates the objectConstructorReturnsObject
Constructors need to return objectsDeferredReturn
A return statement in the middle of a method doesn't return immediatelyIfIsLoop
The body of an if statement executes repeatedly, as long as the condition holdsOutsideInMethodNesting
Nested method calls are invoked outside inReturnCall
Return statements need () around the return valueStringLiteralNoObject
One needs to call the String constructor to get a String object from a literal