Day 3 — JAVA tutorial for beginners: What the program lines say?

Vinod
3 min readOct 27, 2022

--

In our previous article,Day 2 — JAVA tutorial for beginners: My first JAVA Program, we have written out first Java program.

Code:

Java code for hello world program

Output:

Let’s examine what each sentence means right now. Every word in English has a distinct meaning and is classified into one of the parts of speech, which include verbs, adjectives, nouns, and more. The same is true for Java, where each keyword has a distinct meaning. Let’s look at one example first before moving on.

When a buddy asks you to return his book to the library, you create a mental picture in your head that includes the steps below.

· Take your buddy’s book

· Drive to college

· Park your vehicle

· Go to the library

· Give the book back

Let’s develop some code to implement the preceding steps.

When we look at the code, we can see the task steps.
1.The task’s name is returnTheBook.
2.Make a list of everything you need to do- drive the car, go to the library, and so on.
3. Your fried mentioned that you must return the book. giveBook

So you had a plan in mind. Similarly, with Java code, there are methods for completing tasks or steps. In our program, we can see public, static, void, main, String, and args.

As previously mentioned, all of these phrases have distinct meanings in Java. Let’s focus on the primary method which is main for the time being. The computer automatically run the main method and then executes the tasks or instructions in the program body. The line System.out.println(“My First JAVA Program”); appears in the program body of our example. This command instructs the computer to print the My First Java Program.

You may be wondering why System.out.println is used. Why? Because this method is defined in our JAVA API to display the text whenever we call System.out.println.

Consider the following analogy: names.

There are a lot of persons with the first name Michael. How can we distinguish between Michael Brooks, an American talk show personality, and Michael Brooks, a politician? by stating Michael Brooks, an America host, and Michael Brooks, a politician. Similar to this, Java offers a variety of println methods, so we use System.out.println to display the message.

The Java class will be covered in the following blog. Continue to read!

--

--

No responses yet