Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
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
4 Antworten
+ 9
No; you cannot declare or define a method outside a class in Java.
+ 9
Sukhbir khalsa You need an explanation perhaps...
The most useful reference I've found:
https://www.quora.com/Can-we-declare-the-member-function-outside-the-class-in-Java-If-Yes-How-No-Why
+ 2
thanks Dev
0
why Dev