Results 1 to 2 of 2
Thread: Check a list , true false
- 10-17-2013, 10:56 PM #1
Member
- Join Date
- Oct 2013
- Posts
- 15
- Rep Power
- 0
Check a list , true false
Hello, I'm in desperate need of some quick help! ;D
Let's say I have a hotel, and I want to check what rooms are available, simple true or false.
I have 4 rooms on each floor, and 4 floors. Let's just call them floor A,B,C,D and room A1,A2 etc..
How whould someting like this look like, and how do I change the value (true or false) of one specific room?
- 10-17-2013, 11:11 PM #2
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 13
Re: Check a list , true false
It depends on how you have your rooms arranged. You could use either a 4 x 4 array, a List of Lists, or a Map. Then you just use the appropriate technique to access the desired element in the data structure (aka, room) and change its status.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
Similar Threads
-
Boolean Arrays true/false switch
By LetsG0Blue in forum New To JavaReplies: 20Last Post: 03-20-2013, 12:14 PM -
[FIXED]ArrayList of booleans, check if all of the list is false?
By Lionlev in forum New To JavaReplies: 1Last Post: 10-16-2012, 11:34 PM -
how to balance true and false instances per id ?
By aneuryzma in forum New To JavaReplies: 1Last Post: 03-27-2011, 03:35 PM -
Prime Number - true , false
By pinkdreammsss in forum Java AppletsReplies: 11Last Post: 05-04-2010, 03:49 PM
Bookmarks