0
Public static void
Can someone please explain why public static void always is there?
6 Respostas
+ 1
Walt Rothschild
This the main method. You need it to execute your code.
But as HonFu mentioned it is better to take it as a fact. You will learn about it if you get introduced into classes/methods.
+ 1
public static void main(String[] args)
public --> access modifier
static --> non-access modifier
void --> return type
This line is a must to run your java code.
If you didn't understand any of these kindly complete the java course and you will come to know.
0
The explanation of this, if the context is still missing (because you're just starting), tends to only lead to more confusion.
In my opinion, it's best to just take it as a given and go on with your study of the basics. This will naturally become clear after you studied the tutorial.
If not, then at least you'll have the context to understand the explanation.
0
does either one of the characters have to be in the code?
0
Yes, it's necessary in this case.
0
Could you give an example?