In Python I can do some simple stuff like:
# declare lists
A =["a","bnbnb"]
B = [1,2,3]
C = ['x'] + A # (Simple Append)
# iterate over both lists
for x in [A,B,C]: # (Create list of lists on the fly for for loops)
do something to X[0]
And so on.
I am new to Java - and understand that arrays are fixed size, but lists and array lists arent. How would I mimic the above?
Here is my failed attempt
# declare lists
String[] A ={"a","bnbnb"}
String[] B = [1,2,3]
Stuck here C = ['x'] + A (Simple Append)
# iterate over both lists
for x in [A,B,C]: (Cant seem to do this either)
# do something to X[0]
Using ArrayLists just kept making it more cumbersome - bet I am missing something obvious.