Public class Solution { public static void main( (String) [] args ); //This was the main method other wise know as function declared. print("Java is easy to learn"); //This was the command which created an object print, though it not a variable so can not be output in system.out.println. so a new method was declare to make the it has a variable so public static void print( String s); was declared so that you output the variable s as the answer. see solution below. system.out.println(s);