I Had below element in my occupy.txt which tells number of people in each room
1 3 4 1 0 3 4 2 1 5
and below code is for checking how Many people are in each room
It Works Perfectly fine For Room number 0 to 9 But When I enter Room number Above This instead of
throwing element not found exception it always says Like Room 12 Has 1 Guests any Advice
Thanks In ADVANCE !!!
I added code tags to your post. Always use the tags; it would have looked a lot better if you had indented the code correctly.
Never never close a Scanner pointing to System.in.
You have not explained how your file works. What do the numbers mean? Maybe you should have a room class which records the room number and how many people have booked.