From the course: Java 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Hello World

Hello World - Java Tutorial

From the course: Java 8 Essential Training

Start my 1-month free trial

Hello World

- For my first Java programming exercise, I'll create a Java source code file, using a simple text editor. On Windows, I can do this using Notepad, or any other text editor I like. If you're working on Mac and you don't already have a text editor installed, you might try TextWrangler, a free text editor from Bare Bones Software. To declare a Java class, start with the keyword public. That's called an access modifier, and it means that the class I'm about to declare is available to the entire application. Then add the keyword class. And then the name of the class, which I'll simply call Main, with an upper case M. All Java class names should start with an upper case initial character. Next, add a code block consisting of a pair of braces. In most Java coding examples, you'll see the opening brace appear on the same line as the preceding keywords, and then the closing brace should go down on the next line. And can align with the first keyword, such as public. Now anything I declare…

Contents