vendredi 8 janvier 2016

confused about define of class variables in IF statement [duplicate]

This question already has an answer here:

I am trying to work on code and I am confused by this compile error. here is my code below in EFTscreen.java. When I try to acccess 'EFTresults' variables I get a compile error in NetBeans saying 'Cannot find symbol". But I put the request.setAttribute inside the IF statement it doesn't give me an error. Can someone please explain this? Is there a problem with my IF statement

        if (wkScheduleNum != 0) 
            {
              Sum_EFTBean EFTresults = EFTQuery.selectSchedule(wkScheduleNum, wkContract) ;

            }
        else
        {
            List<Sum_EFTBean> EFTresults ; 
            EFTresults = EFTQuery.selectDates(wkStatus, wkCreationFormat) ;
        }

        request.setAttribute("EFTresults", EFTresults);

Thanks for the help

Aucun commentaire:

Enregistrer un commentaire