I have the following code:
public static void main(String[] args) {
String a1 = "aa";
String a2 = "bb";
String a3 = "cc";
String a4 = "dd";
for(int i = 0; i<3; i++){
String a5 = ("a"+ i);
System.out.println("a"+i +"= "+a5);
}
}
I would like to know how you can somehow print the value of the variables above in for
that way or you can't because there it prints a1, a2 and so on and what I want is to print the value of a1
that is aa
.
Thanks for the help in advance