your method has to be inside the class, but outside any other method.
if this method is within the main method, then your code will look something like this:
public class name
{
public static void main(String[] args)
{
//code
yourmethod(parameter); //*somewhere in your code*
}
public static void yourmethod(parameters p)
{
//code
}
}
if it's within a regular class with no main method
public class name
{
public name()
{
//code
}
public void yourmethod(parameters p)
{
//code
}
//other methods
}