+ 2
static - it's like "shared", it means that it will be common for all the objects of a class. void - means nothing. In case of the function return type, it means that function returns nothing. main - special name of the "entry point" function. The main function will be called when the program starts. So a program execution begins with main. So in class Whatever { public static void main() { } } all that means "declare a method in class Whatever, called main, that returns nothing, is shared among all the objects of this class, and is public (anything can access it)" One remark though: you don't actually need an object to be able to call static method.
24th Feb 2018, 1:33 PM
deFault