+ 1

What does the following code in java?

public static void main

11th Jan 2018, 5:38 AM
rohit raj
rohit raj - avatar
4 odpowiedzi
11th Jan 2018, 6:31 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
public = accessible from anywhere within the same project static = can run this method without making an instance of it void = there is no specific return type/ it is just executing what's inside the method main = name of the "main method", every java program starts at
11th Jan 2018, 5:57 AM
Lucien
Lucien - avatar
+ 1
ok
11th Jan 2018, 5:38 AM
rohit raj
rohit raj - avatar
+ 1
in the sense of main method it is such because - public - it needs to accessed from outside of class static - because it needs to be executed fast so jre doesn't need to create object for it. void - again as it needs to be executed fast it doesn't return anything. main(String args[]) it will take all argument in form of string.
11th Jan 2018, 9:06 AM
shobhit
shobhit - avatar