0
How to create method and how to call it?
2 Answers
+ 2
Learn all the lesson in Java Course, and you will know how to do it.
+ 1
method is like
public int sum(int x){
return ++x;
}
in the same class or another one,
to call it, if it's in the same class
type:
sum(any number to do summation);
if it's in another class, u have to create an object
anotherclass object = new anotherclass;
then call like this
object.sum(any number) ;