"When you write x = 0, x is an int...so you can not do x[age1] because x is int" . . . .