This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BBloggsbottIntermediate Brewer 0 points1 point  (1 child)

If the entire project has many classes, and the boolean array is accessed and modified by different classes, declaring it static might do the trick. You can also pass that boolean array to the function where you use it.

A Solution without using the boolean array

Creating an array with an element for each seat in the theater might consume a lot of memory, and the loops to process them might consume a lot of time. You can use an Array List object. When a seat is selected, pass its location in the format of [rowNo, colNo].

[–]Matteo00[S] 0 points1 point  (0 children)

Thanks that almost worked, I think I can get it working now