In Java is it possible to execute a method call given the class instance and the method call saved as a string?
I want to make a sequence of different method calls random so I was going to put the method parts in a list as Strings and shuffle them. How do I then use this string as part of a method call? e.g. myClass.temp below is being treated as a property. If I put the full myClaims. in the List as Objects it will try to execute them there.
List<String> methodList = new ArrayList<String>()
methodList.add("createMethodx(params...)")
methodList.add("createMethody(params...)")
methodList.add("insertMethodz(params...)")
String temp = methodList.get(0)
myClass.temp //Execute the method.....doesn't work