Let's say I have Java class:
public class Animal
{
public String dog = "Rex";
}
In another class I am doing like this:
Animal mAnimal = new Animal();
String attributeCaller = "dog";
PROBLEM: how to call mAnimal attribute "dog" by using String "attributeCaller" value in Java? I mean to do something like this:
String dogName = mAnimal.attributeCaller;
which simply should be equal to (convenient way of calling attributes in Java):
String dogName = mAnimal.dog;