Sololearn: Learn to Code
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));
16th Oct 2019, 4:23 AM
Taste
Taste - avatar