Example class:
class Test {
public int marks;
public String location;
public String show(){
return "Good morning!";
}
}
Is there a way I can access marks
and locations
by a getter? Maybe like so:
Test t = new Test();
System.out.println(t.get("marks"));
and maybe
System.out.println(t.call("show"));
The exact use case I have is to be able to access R.id.[fieldname] for accessing Android Resource ID
Can this work ?
R.id.getClass().getField("date").get(R.id) ?
How could I do this ?