Forums Register Login

Inserting Object with 2 Attributes into an array

+Pie Number of slices to send: Send
Hello,
in the following Method:


Im not exactly sure how to add the Object into the array. My confusion is caused by the two separate parameters of name and labor (Name represents the name of the Rooms to add, and labor represents whether the room is a laboratory or not (True for it is a laboratory and false for it is not))
The object Room is made up of the parameters name and labor.
Im not exactly sure how to add the two.
Do you have any pointers or hints at how this can be accomplished?
Thanks
+Pie Number of slices to send: Send
The adding has to go in the else block of the if statement.
+Pie Number of slices to send: Send
Where is your array?

Don't use labor as the name of a boolean. It is very confusing particularly in an American website where it means hard work. Use something like isLaboratory, or whatever that would be in your language.
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 364 times.
Similar Threads
Examples for Builder Patterns??
Creating a Method that adds elements of another Class to an array
Library/Book assignment
Builder Pattern - Why does it looks like another Creational pattern
help with a booking system
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:12:11.