I have a use case where I have to generate functions based on a template, preferably in runtime. For e.g. let's say I have a function
public void function1(){
//do something
}
Now, let's say I want to generate 50 more functions that does exactly the same thing, how can I achieve that? I understand I can hardcode 50 functions like this:
public void function3(){
//do the same thing
}
public void function4(){
//do the same thing
}
.
.
public void function50(){
//do the same thing
}
But, I want to know if this can be generated during compile/runtime to keep the code clean.
PS: Calling the same function in a for loop or using classes is not possible for my use case as I need to have 50 different functions as a part of the code.