Somebody knows or has an idea on how to simplify the code in getting the multiple variables from another class. Below are the structure of my program :
Data.java
//composed of 30 variables with almost the same variable name
String dat1 = "";
String dat2 ="";
.
.
.
String dat30="";
Get.java
//here, I need to get the variables from Data.java and put inside the loop
for(int i=0; i<=30; i++) {
String dat1 = getField(Data.dat1).getData();
}
Is there anyway to loop the dat1~dat30 variable from another class? Thank you in advance for those who will help ;)