I want to save the values and types of arguments passed to a method.
This is a requirement of a bigger project that I am doing. So, presently I need to save the values and types of arguments, in the order they are declared in method signature, right at the first line of method body. However, I will not know the number of arguments. Hence I am looking for a JAVA technique that enlists all its method parameters with their corresponding value.
The number of arguments can be very large and the names of arguments wouldn't be known.
If this cannot happen directly, any suggestion towards how this could be done will be helpful.
public void stay(String temp1, int temp2, double temp3){
//**--code to save the values of temp1, temp2, temp3 somehow--**
//method body that will change the value of parameters
}
Aucun commentaire:
Enregistrer un commentaire