what is public static void main (String arts [ ] ) ??? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

what is public static void main (String arts [ ] ) ???

15th Sep 2016, 3:18 AM
jesus
jesus - avatar
4 Respostas
+ 1
In java it is a way to declaring main method just like in c by void main
15th Sep 2016, 5:32 AM
Rahul Bansal
Rahul Bansal - avatar
+ 1
ā€¢ Public : this method can be accessed publicly. Such that any instance can call this method. ā€¢Static : This method will not change within the instances. Also does not refer to any non-static objects. ā€¢Void: This method returns nothing. This is return type. ā€¢String: argument list type. It is string array. You are declaring it by [] ā€¢args: parameter name. it is an array. Alternatively, you can do this also. public static int main(String[] args) public static void main(String args[]) Hope this has solved your doubt.
15th Sep 2016, 8:01 AM
Nagendra Prajwal
Nagendra Prajwal - avatar
+ 1
main method will be called by JVM not by the programmer so JVM should call with out the need of object so it was declared as static
16th Sep 2016, 1:33 PM
Sarath chalapaka
Sarath chalapaka - avatar
0
static refers to...?
15th Sep 2016, 5:42 AM
jesus
jesus - avatar