aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About potential trips/traps in the SCJP exam in FAQ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About potential trips/traps in the SCJP exam in FAQ" Watch "About potential trips/traps in the SCJP exam in FAQ" New topic
Author

About potential trips/traps in the SCJP exam in FAQ

Yeray Santana Borges
Ranch Hand

Joined: Mar 02, 2008
Posts: 46
Hi,

I don´t undestand this points in the FAQ about potential trips/trap in SCJP exam. I would like see an example code about it, can you help me?.

1 - Forward references to variables gives a compiler error.
2- All comparisons involving NaN and a non-NaN always result in false.
3- You can never cast objects of sibling classes (sharing the same parent).

Thanks in advance


SCJP 6 - SCWCD 5 - SCBCD 5
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

Forward references to variables gives a compiler error



Even before b is initialized , a is trying to access it. ERROR. However forward reference id possible in somecase.


All comparisons involving NaN and a non-NaN always result in false.

NaN is defined in Double and Float as,
public static final float NaN = 0.0f / 0.0f; (Float class)
public static final double NaN = 0.0d / 0.0; (Double class)

Except != operator all other comparision results in false.

You can never cast objects of sibling classes (sharing the same parent).



Results in error because C & B does not share any relation directly.


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
 
 
subject: About potential trips/traps in the SCJP exam in FAQ
 
Similar Threads
SCJP FAQ
Difference between instanceof and instanceOf
SCJP 1.4 tips
Cleared SCJP 5 with 78%
SCJP or not ?