Static Method and non-static method :-
1. Static Method:
When ever we have to call static method/function,we don't need to create object or instantiating of that method and cant't usenew
keyword because when the class are load and compile then static keyword by default instantiate or create object of that class method, so that why we directly call static method.
In reference ofstatic void main(args[])
as we had discuss about static remainvoid Main
.void
is data type which return nothing andMain(args[])
is entry point to execution of program.
2. Non-Static Method:
In this method we have to instantiating or creating object of class method to call the method/function of class using new keyword.like
If a class nameTest
have non-static method and nameshow()
,then how it would call an instantiating