This example uses the Scanner class for input (not JOptionPane).
Below are two Java programs that do exactly the same thing.
String handling methods using a one class program and multiple static variables and methods. Therefore no parameter passing needed.
==================================================================
String handling methods using a two class program and multiple non-static methods that pass parameters.