answersLogoWhite

0

The standard "Hello World" program in Java looks like:

class HelloWorld {

public void main(String[] args)

{

System.out.println("Hello World");

}

} //end class

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
JudyJudy
Simplicity is my specialty.
Chat with Judy
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
More answers

Here is a program which I copied from the Wikipedia article on the Java programming language:

class HelloWorldApp {

public static void main(String[] args) {

System.out.println("Hello World!"); // Display the string.

}

}

Note that in some Java IDEs, if you create a new Java class, the outer "skeleton", which is standard for many classes, is provided automatically; in this case, all you have to complete is the line that starts with System.out.println.

You can experiment with this, and print other texts; or do calculations; you can also add several System.out.println() lines, for example:

System.out.println("Yes, I am starting to learn Java");

System.out.println("1 + 2"); // Result is "1 + 2"

System.out.println(1 + 2); // Result is 3

System.out.println(1 + 2 * 3); // Result is 7

f

User Avatar

Wiki User

11y ago
User Avatar

Add your answer:

Earn +20 pts
Q: How do you display hello world java?
Write your answer...
Submit
Still have questions?
magnify glass
imp