This week's book giveaway is in the Performance forum. We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line! See this thread for details.
at line marked as 1 , compiler complains as variable k might not have been initialised I don't understand why?? if k is not visible to case 3 block , it should have given the error... variable k undefined. And if it is visible (in scope on case 3 block) then k is initialised , then why the the copiler complains... thanx in advance. Rashmi
posted 14 years ago
k would be initialized only the switch statement hits the case2 and k is a local variable so it does not get initialized auto. ------------------ Have a nice day, Unless you've made other plans.