SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
BEE MBA PMP SCJP-6
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Tom : Did you read my post? The code as written runs fine,
if 'msg' is static, because Apple is not instantiated.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
After puzzling a while I think this is the cause. Since Apple has no String constructor
(just the default), and Fruit has no default constructor (only String), there is no way
to initialize an Apple object. Clever compiler - ey?
BEE MBA PMP SCJP-6
Jim Hoglund wrote:The code runs because it does not try to create an Apple object.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Milind Chaudhary wrote:
Is that a rule? because i have not read it.. till now.. maybe it would be a few pages later..
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Milind Chaudhary wrote:Thanks for your answer..
That is why I like this forum so much.. because one gets answers within minutes.. the biggest and most active forum i have seen till now..
Milind Chaudhary wrote:
Just another question-
Can anyone suggest a really good book for algorithms and data structures?
I know that this is Javaranch and meant only for Java but i see brilliant programmers here so wanted a little tip from all of you.. You have got to help me.. I want to study these topics for getting a good internship..
Expecting a positive response..
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Caution : There must be a particular constructor signature only if it is
called.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
BEE MBA PMP SCJP-6
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jim Hoglund wrote:As for Milind's code not compiling, can anyone explain why this should
be so? It makes sense to me that the code should run okay. What does
not make sense is the compiler error.
BEE MBA PMP SCJP-6
BEE MBA PMP SCJP-6
Jim wrote:Ankit : Please focus on my second paragraph. It's the only open question; the "bogus" compiler error.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
BEE MBA PMP SCJP-6
BEE MBA PMP SCJP-6
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Regards,
Avishkar Nikale
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Can we call the implicit constructor given by the compiler No-Arg-Just-Super()-In-Body-By-Default constructor?
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links