Guide to Object-oriented Programming With Java (Buffalo State University Version)
Chapter 2: Your First Java Program
Java is a popular programming language that is especially suited to develop applications for business and the Internet of Things (IoT).
This guide will use the Eclipse IDE (Neon version) to develop the java
code.
Hello World!
Most beginning programmers start with the standard "Hello World" code:
/**
*
* File: helloworld.java
*
* This is a Hello World Application
* It prints a short statement to the standard out
*/
public class HelloWorld {
/**
* The main methid is the entry point for a Java program when executed
*
* @param args String[] - command line arguments passed to program
* @return none
*/
public static void main(String[] args) {
// print to the console
System.out.println("Hello World!");
}
}
helloworld.java
The Eclipse Console would look like this:

<terminated>
Hello World!
HelloWorld.java
Console OutputJava Comments
Java provides inline, single line, multi-line, and JavaDoc comments. You can even use HTML tags in JavaDoc comments.
JavaDoc comments: /** * The <b>main</b> method is the entry point for a Java program when executed * * @param args String[] - command line arguments passed to program * @return none */ Multi-line comments: /* This is a multi-line comment */ Single line comments: // print to the console Inline comments: System.out.println("Hello World!");// print this outFigure 2-3: Java Comment Examples