+ 5

public static void main(String[] arg) { ???

What is the difference between: 1. static void.... 2. static.... 3. public static void main.... 4. private void.... 5. public int.... And also how do they work when I want to code something? Sorry if I didn't catch on yet. Doesn't seem to make sense when to use them.

1st Mar 2017, 9:49 PM
PaperGami T.
PaperGami T. - avatar
4 Réponses
+ 25
Sololearn Java course covers up your question.
1st Mar 2017, 9:58 PM
Igor Makarsky
Igor Makarsky - avatar
+ 4
ACCESS MODIFIERS - public/private/default/protected. These are used to restrict a part of your code(variables/methods / class etc) Example, If you want one of your variable to be accessible only in that class, use private before datatype.. STATIC Declaring a part of your code as static means that it can be called directly from other classes , without creating an object first. VOID When we declare a method as void, it means it doesn't return anything. If you need more help msg me. Also try searching on the internet as that will teach you more different new things.
1st Mar 2017, 10:02 PM
Meharban Singh
Meharban Singh - avatar
+ 2
Sometimes its difficult to understand Sololearn. In that case I use comment of that lesson(top right corner pf that lesson).
2nd Mar 2017, 5:31 AM
Meharban Singh
Meharban Singh - avatar
0
aaagg
10th May 2017, 1:11 AM
Ezequiel Nuñez
Ezequiel Nuñez - avatar