Can you write a method inside the main method? For example I found this code:
public class TestMax { public static void main(String[] args) { int i =
If you want to use it, in this scenario, make it static and place it in the class but outside the main method (as you have it in your code). Then you can call it from within main().
static
main()