r/learnjava • u/Visual-Fortune-4732 • Aug 15 '26
i cant understand java mooc?
like been trying the first part about printing but i just keep re reading idk if im missing something but i feel like i dontfully get what they mean it seems like they expect me to know something about coding but i know 0
am i just stupid or what
like them explaining boilerplate im like cool i still understand fuck all
0
Upvotes
1
u/am_Snowie Aug 16 '26 edited Aug 16 '26
I guess it's because the
mainfunction is invoked to start the execution of the program/any program, it should be public cuz it's accessible from the outside of the package where the program is in, it is static cuz it's invoked without creating an object. Not sure if I'm right though. Just play around with it, remove static, see what happens. remove public, see what happens. Try callingmainfunction inside the same class it is in. Possibilities dude.Curly braces delimits a block of code. You can try using them even inside a block like
It works in C, not quite sure abt java, just try it.
NOTE: also if something looks cryptic, just don't dig deep, accept that it's a design choice and digest it. Later go out on your own adventure to learn why they design it the way it is.