This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Mahesh G P wrote:My query is "If variable is not initiazlied won't it be null"?
even the declaration wont be in .class file . i.e compiler removes String str; if str doesnt have assigment further lines.
So, checking str have further assignment logic in compiler may be not smart enough to prevent error that you get now ;)