Suppose my code is
public class GetValueInLoop{
public static void main(String[] args) throws InterruptedException {
int a1=3;
int a2=4;
int a3=5;
int result;
for(int i=1; i<4;i++){
result = a(i);
System.out.println("Value of a(i): "+result );
}
}
How can I get output like
Value of a1:3
Value of a2:4
Value of a3:5
Can anyone help me out Thanks