a simple int comparison causing issue

knoveplus

New Member
I've got the following code:\[code\] int bookingType=0; //mapSize=mapLoaded.size(); DateTime startx = new DateTime(startDate.getTime()); DateTime endx = new DateTime(endDate.getTime()); //booking status boolean possible = false; //Booking type: 1 = Project, 2 = Training if(requestType.equals("Project")){ bookingType = 1; }else if(requestType.equals("Training")){ bookingType = 2; } //produces submap //mapSize = bookingType; bookingType = 1; if(bookingType==1) { ..... }else if(bookingType==2){ .... }\[/code\]The error after testing is when am checking value of bookingType. usually the == would work but here it seems to be skipping it altogether. I checked the value of bookingType and it does change to 1 or 2 based on requestType. Why is the if() not working? Thanks,
 
Top