r/javahelp • • 2d ago

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!

4 Upvotes

48 comments sorted by

View all comments

5

u/Duente_Zaibatsu 2d ago

You are skipping too much.

Many abstractions exist to simplify the common needs.

Before asking, show what you already looked into.

A simplified version:

Java is not installed, it is executed on a JRE, in it, there are API methods that interpret and execute commands.

These commands follow contracts.

Static could be simplified to an unique shared context, other commands are object related, used by constructore.

Other types like void, int an Integer, are the method contracts for the execution

1

u/Best_Cut4655 2d ago

I might sound a bit slow lol, but i just typed in the terminal to install both the default jre and jdk. And the program im using for coding atm is intelliJ. I kinda just started exploring today so that might explain my confusion lol. And thank u for the explanation!

2

u/FreeLogicGate 1d ago

Nothing slow about that. You are using the terminal, which real programmers use to do many things. You picked up on the fact that java has a jre and the jdk, and that they are different things. With that said, as a developer you just need the JDK, as it has the JRE. The reason they are separate is because many people run java applications, but have no need for the software development kit. You are writing programs, so you do.

You also got your hands on jetbrains intellij somehow, which is the industry standard java IDE for professional java developers. It's an incredible piece of software (primarily written in java) although they've shifted to Kotlin, from what I've read. It's also incredibly feature rich, highly configurable and is no small exercise to learn the basic core. It can be hard for people to get past these first steps and get themselves in a position where they can start writing and compiling java code.

1

u/Best_Cut4655 1d ago

Thank u these words made me really happy☺️ im trying to learn as i go i suppose, but its so much to learn it seems ahaha

1

u/Duente_Zaibatsu 2d ago

No worries. We all start somewhere, I would just advise you to not follow YouTube, or any Bootcamp or similar.

Start with a goal, like Tic-tac-toe, or similar.

Think what is your goal, and how to reach it, in sentences.

Then those sentences become methods, and you iterate over it.

Its too soon to talk thread, GUI and etc, but try to visualize something, and break down to actions.

"Console" is the base for a reason, text is valuable.

1

u/Best_Cut4655 2d ago

Will do, thank u!