0

Is it necessary to declare PSVM inside class? Can we declare PSVM without class in java?

can public static void main(Strinf args[]) declared without being object of any class

10th Jul 2018, 8:33 AM
Sukhbir Singh Khalsa
Sukhbir Singh  Khalsa - avatar
4 odpowiedzi
+ 9
No; you cannot declare or define a method outside a class in Java.
10th Jul 2018, 8:50 AM
Dev
Dev - avatar
+ 9
10th Jul 2018, 9:12 AM
Dev
Dev - avatar
+ 2
thanks Dev
10th Jul 2018, 9:15 AM
Sukhbir Singh Khalsa
Sukhbir Singh  Khalsa - avatar
0
why Dev
10th Jul 2018, 8:50 AM
Sukhbir Singh Khalsa
Sukhbir Singh  Khalsa - avatar