0% found this document useful (0 votes)
3 views1 page

Java HelloWorld and Color Classes

This document provides examples of two simple Java programs. The first program, HelloWorld, prints the text "Hello, World" when run. The second program, Color, prompts the user to input a color, stores it as a string, and prints the message "The color is: " followed by the input color. Both programs are compiled using javac and run using java.

Uploaded by

rdk84
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java HelloWorld and Color Classes

This document provides examples of two simple Java programs. The first program, HelloWorld, prints the text "Hello, World" when run. The second program, Color, prompts the user to input a color, stores it as a string, and prints the message "The color is: " followed by the input color. Both programs are compiled using javac and run using java.

Uploaded by

rdk84
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java classes: 1.

HelloWord
public class HelloWorld { public static void main(String[] args) { [Link]("Hello, World"); } }

Compile:
javac [Link] Run: java HelloWorld 2. Color public class Color { public static void main(String[] args) { [Link]("Please insert a color:"); String color = [Link](); [Link](The color is : + color); } }

Compile:
javac [Link] Run: java Color

You might also like