Some things are not explained

when I finished the first lesson in Java I have noticed some code on the line 1 and 2 that wasn’t explained in the beginning,so can someone explain it now,what is this code? Thanks.

java jezik

That will be explained moving forward.

The first line defines a new public class. Everything in Java is class based, which you will learn more about in coming lessons. A little reading on the side is helpful, as you go.

The second line defines a method. The meanings of the terms, public, static and void are upcoming. Public means it can be accessed from anywhere. ‘static’ means it does not change, and void means there is no return value. Forgive my vagueness.

1 Like

I want to ask another thing,is that a start up code that I need to begin in Java,just like there is a start up code in C++: #include using namespace std; int main() etc…?

1 Like

Sadly, I don’t have an answer for that question since I’ve never worked with it locally or in a sandbox. The code does need to be compiled into a .java executable, but that part of the process is foreign to me.

What I can say is that if you have no JavaScript under your belt, take a segue and get versed in that language. Mind, if you are adept at C (which I am not) you should be pretty familiar with the process (and the syntax, which is quite similar). In the case of choosing a language as a starting point, I always recommend JavaScript.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.