Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
SCJP2. Please Indent your code using UBB Code
---------------------------<br />Shafkat Talli<br />SCJP 1.4, August 2003.
---------------------------<br />Shafkat Talli<br />SCJP 1.4, August 2003.
Originally posted by Shafkat Talli:
hmm, i wonder why it spits out null,
i thought the instance variable for da object was set before the constructor executed ?
Originally posted by Shafkat Talli:
by the way, both the classes have default access, so there will be no output, cause there is no public class. I ran it and it didnt show anything cause of that.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Anupreet Arora:
Would the behaviour change if the SuperClass was declared abstract. Lets say it had an abstarct method also in its definition?
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP2. Please Indent your code using UBB Code
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP2. Please Indent your code using UBB Code
You are correct. I didn't get that quite right. The JLS says, "�such constant fields must always appear to have been initialized; the default initial value for the type of such a field must never be observed." So it applies only to inline constants which are finals variables that are initialized with a constant value.Originally posted by Jose Botella:
The example with the blank final still prints null.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Consider Paul's rocket mass heater. |