r/javahelp • u/Best_Cut4655 • Oct 12 '26
Homework What the hell is going on?
Hello everybody, I am so lost. I just started learning Java and while i think its extremely interesting, and can loose track of time. It is also very complicated, well atleast to me since i dont have any prior experience.
I just ”learnt” to write my first Hello World! Code. But tbh i only copied the text straight off a youtube video.
Thing is i understand the main command, like: System.out.println(”Hello World!”);
But what is this whole main class and static void things? Not to mention all the {} symbols that seem to be oddly placed?😅
If anyone could explain or know a good youtube video or similiar to learn id appreciate it a lot!
View all comments
1
u/FreeLogicGate Oct 13 '26 edited Oct 13 '26
I'm sure you will learn these things as you go, but just answering your few questions directly:
public static void main(String[] args).When you run the program with java, the jvm looks for the main function and start execution. The term for this is the "entry point".As you go on, you will no doubt have many such questions, so hopefully you are making notes of the things that seem mysterious. Over time you'll understand it better, but Java is heavily Object oriented. You stated that you understood the
System.out.println(”Hello World!”);code, but I'm going to go out on a limb, and suggest that you really don't understand it to the degree you think you do. Obviously, you can see what it does, but how would you find the documentation of it, and what is actually happening with that line of code?You would probably be surprised to find that the System class, defined here, has no println method.
You might also ask yourself how you can execute a method that is part of a class, when there was no class object instantiated. Last but not least, you will need to figure out how it is that you can call a method that doesn't even exist in the definition of the System class. A hint would be to see what the System.out method returns. It will take some time to get past basic syntax and for you to start becoming comfortable with OOP.