0

[JAVA 2D ARRAY] How to return last column?

I have two different arrays which are instantiated in two different child classes. I need to make a method in the abstract parent class to query the array depending on which array the user selects. Each array is a different size so I don’t want to put a set index for the method. I’m guessing I’ll need a loop to keep going through the index’s and then stopping the loop and returning the final index. P.s I’m not interested about the element inside, only want to return last column index. Thanks appreciate your help.

2nd Sep 2019, 12:58 PM
Raj Grewal
Raj Grewal - avatar
2 Answers
0
~ swim ~ I just want to return the index number nothing else. I’m not sure how to tackle this as I’m only 5 weeks in Java so far.
2nd Sep 2019, 7:37 PM
Raj Grewal
Raj Grewal - avatar