Mnau Lubi wrote:So I can just pass one parameter (the class) instead of having to execute all the getters in that class to obtain all the variables and then call the method with thousand parameters.
Do you mean that you want to set the fields of all existing instances of a certain class to certain values? There is no way in Java to find all existing instances of a class, if you only know the class. Java doesn't keep track of all the instances of a class; you have to do that yourself. So if that's what you mean, then that's not possible.
If you have all your Track objects in a collection, for example a List, you could ofcourse pass that List to your method:
Or... are you maybe confusing the terms "class" and "object", and do you simply mean that you want to pass a Track object to your method: