How to Make a Hello World Program in Java

This is the first post in my "new" blog. Actually, this blog was a mixed Niche which has no clear topic. Build in 2010 and has mo...

This is the first post in my "new" blog. Actually, this blog was a mixed Niche which has no clear topic. Build in 2010 and has more than 1000 posts, this blog has no significant results in page views. It just has 1000 page views in a day.

But now i decided to delete all of the posts and i want to make this blog is just about technology. In this tutorial i will show you how to make a simple Hello World in Java. What is Hello World?

In Programming world, the people must be familiar with Hello World. Hello World is a simple two words that usually is used to learn your first programming. Usually, at the first learning about programming language, we make a program that print "Hello World" in the screen. In this post, i will show you how to make a simple Hello World program that make in Java Language.


Before you can compile and run the program, make sure your Environment compliance with Java language by install Java Development Kit (JDK).
public class HelloWorld {
          public static void main(String[] args) {
                    System.out.println("Hello, World");
          }
}
public class HelloWorld  is the identity of your class file. Notice this name must be same as your file name. If you use above code, so you must save your file as HelloWorld.java

public static void main(String[] args) is called as main method. This method is related to what the program will do. This method may call the other method to execute it, or just execute some code inside this method. This method usually has "String[] args" inside the bracket to make some working parameter while running a compiled program. The further explanation about java programming will be explained in the future post.

System.out.println("Hello, World"); is used to show Hello World string in the screen. System.out.println will show anything inside the bracket and make a line break in the end.

In Java programming language, you will notice open bracket '{' and closing bracket.'}'. If there is one open bracket, then there is must be one closing bracket to close it. In above case, you will see two open bracket and two closing bracket.

The brackets will define the border of the codes. Refer to the above codes, the codes in the inside bracket is define main method, and the codes in the outside is define the codes of class HelloWorld.

Compile & Run

If you have make your Java file (HelloWorld.java) and make your Hello World codes like the above sample of codes, you can compiled and run the program.

If you use Command Prompt, you can compiled it with :
javac HelloWorld.java
Make sure the path in your Command Prompt is same as the location of the HelloWorld.java.

After that you can run the program with this command :
java HelloWorld
And now you will see 'Hello World' output in your Command Prompt.


PLEASE LIKE OUR FACEBOOK FANPAGE close button

Related

programming 2513273788691872459

Post a Comment

To insert image or video : [img]image-link[/img] or [video]video-link[/video]

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

idlol.tv

RecentPopularRandom

Recent

6 Ways to Make Money Blogging

Everyone can create a blog and it isn't difficult. However, if we talk about making money from a blog, probably many blogger still don't understand how to do it. Monetize a blog is not easy for a beginner blogg...

How to Make a Hello World Program in C++

The hello world program in C++ contains the basics components in C++ program. Hello World Program is a program that will display "Hello World" text in the screen. This program is usually made when you want...

Tips to Make Your Blog Look More Professional

First impressions seen by the reader when reading the blog content is about the appearance. A good looking blog will make the readers comfortable in reading the content of your blog. Besides, your good design b...

The Best Placement for PPC Adsense

The position determining achievement , maybe that's a term that is suitable to describe the positioning of Adsense . Because of the better place of adsense location, income would be better. Good Adsense placeme...

How to Make a Hello World Program in C

Hello World program in C is a program that usually is made at the first time when a person want to learn C Language. This is a very simple program. If you run this program, you will see a "Hello World" text in ...

How to Make a Hello World Program in PHP

In the previous post, i explained about Hello World program in Java. And now, i will explain about how to make a Hello World Program in PHP. In PHP language, Hello World program can be made by a very simple cod...

How to Make a Hello World Program in Java

This is the first post in my "new" blog. Actually, this blog was a mixed Niche which has no clear topic. Build in 2010 and has more than 1000 posts, this blog has no significant results in page views. It just ...

Popular

Random

item