r/javahelp • u/kichiDsimp • Aug 31 '22
Unsolved Java Static
Why cannot we use System.out.println(), outside <main()> or any static function ?
0
Upvotes
r/javahelp • u/kichiDsimp • Aug 31 '22
Why cannot we use System.out.println(), outside <main()> or any static function ?
2
u/Chemical-Asparagus58 Sep 01 '22
You can use System.out.println() in all methods, maybe you had a typo or didn't add a semicolon at the end when you wrote it into your code so it didn't work.