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 =
No, you can't declare a method inside another method.
If you look closely at the code you provided it is just a case of bad formatting, the main method ends before the max method is declared.
main
max