File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Definite assignments/ Unreachable statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Definite assignments/ Unreachable statements" Watch "Definite assignments/ Unreachable statements" New topic

Definite assignments/ Unreachable statements

sanjana narayanan
Ranch Hand

Joined: Nov 25, 2003
Posts: 142

Does anyone have your own prepared notes on Definite assignements and Unreachable stmts. Its pretty confusing for me to go through the JLS stuff on these areas.
Any ideas/tips/notes..Pl share with me..

Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

While you're waiting for a reply with some actual notes about unreachable statements -- do a search for "unreachable" in this forum -- there's been lots of good thread recently about the topic. (I'd recommend going to the end of the list, most current, and work backwards)

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Hi Sanjana,
I agree that is very confusing to try to learn about definitely assigned and unreachable by reading the JLS.
I learned by seeing a lot of examples. I learned by reading every post on these topics and trying to answer the question in a way that is consistent with the JLS. Look at the example, find the place in the JLS that explains the example, then think about why it is that way, try to explain it intuitively.
I agree with Jessica. It may be very time-consuming to search the archives for examples that other people have posted. Normally I prefer get the precise explanation from the JLS. But in this case, seeing examples helped me much more.
But don't just read and work examples. Collect them and organize them in a folder. Look for similarities and patterns. Reduce all the examples to some general cases.
Don't try to understand every special case handled by the JLS, unless you want to write a compiler. Be satisfied with the cases covered by the examples. That's a good start.
[ December 05, 2003: Message edited by: Marlene Miller ]
I agree. Here's the link:
subject: Definite assignments/ Unreachable statements
It's not a secret anymore!