This function you created has to be inside a class. If you go and create an instance of this class in another class of yours (in the same package) ex: Let's say you have this
public class Blah {
public int plus (int one, int two) {
return one + two;
}
}
and then you have the class where you want to use blah:
public class otherclass {
public void otherfunc{
int yo,ye,yu;
Blah instanceOfBlah = new Blah ();
yu = instanceOfBlah.plus(yo,ye);
}
}
You can use this way in any of your other classes to access the plus function. If those other classes belong to different packages you might have to import the blah class tho.