Hi everyone, today we are going to focus on Methods in java.If you ask yourself why we use it, I can say something about that.To show you what I mean,
1.Methods can be used for clarifying code.
2.It helps us to simplify and design coding.
As you see above picture, method contains modifiers,return data type,name,parameters and body.
In method header, If you use (int,long,double,String) value type, you have to return the same type value from method. On the other hand, you prefer to use (void) data type, you dont need to return it. As for the method name, It is…