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..
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)
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 ]