New course! Every coder should learn Generative AI!
Try a free lesson+ 2
static means you dont need the object to use it. but static method cannot call non-static method.
because main is static method itself, you'll also need a static method so the main can use it.
if max is not static you'll need the object first. the program would looks like this
Program program=new Program();
System.out.println(program.max(8, 17));