I have been using this "logic" in C++ and VB with success, but am tied up in Java... Simply put,
public void DataProviderExample(String user, String pwd, String no_of_links,
String link1, String link2, String link3) {
for (int i=1;i<=no_of_links;i++) {
String link = "link"+i;
System.out.println(link);
}
Now, if the variables link1, link2 and link3 have a value of "X", "Y" and "Z" respectively, upon running this program, I get the following output -
link1
link2
link3
What I want is -
X
Y
Z
Any ideas?
"link" + i, but does some sort of eval(link) which gets the value of the variable with the name defined in the variable link. The code above is the closest he came to that in Java.