Search⌘ K

Writing Your First Java Program

Explore writing your first Java program by understanding the basic syntax and structure. Learn to print output with the classic Hello World example and get familiar with Java program essentials.

We can do a lot with Java. We can write complex algorithms, build mobile and desktop applications, design cool games, and even make sketches on the console!

But let’s slow down a little. Let’s start with a very basic application to get familiar with the nuts and bolts of a basic Java program.

Hello World! in Java 🌏

As you go on to learn more programming languages in the future (hopefully!), you will encounter more “Hello World!” programs.

Note: The “Hello World” phrase was first used by Brian Kernighan as an introductory example for his language B. The phrase was used to replace “hi!”, which had been used previously in his ...