This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Thats because you declared the method (factorial) as Class method. And since main is static , methods can be called directly . Otherwise It can be accessed in non-static way , by creating instance of the class.
1) Try creating an instance of the class in the main method , call the factorial method with the instance. 2)And remove the static modifiers from the methods