I know how to create a method:
public/private static/none dataType/void methodName(arguments) {
}
I was wondering, if I used this:
public static void setStat() {
}
I could have a method that branches off of
public static void setStat() {
}
like so:
Class.setStat().attack(5);
If this is possible, how would I do it?? Could you give me a code example??
EDIT:
I also want to do this:
Class.addStat().attack(5);
So that I can either add or set the stat. I am also confused on what to return in
public static void setStat() {
}
Please provide an example and not just an explanation. I learn from examples so that I know what I'm looking for.
What I have tried:
I have tried looking on google, but all their tutorials seem way too complex and take up lots of time.