Introduction
In this challenge, you'll practice using the System.out.println statement in Java. This is a fundamental skill in Java programming that allows you to output text to the console. You'll modify a simple program to print a greeting message, then compile and run it.
Create a Simple Greeting Program
Now that you've learned about the basic structure of a Java program and how to use System.out.println, let's put that knowledge into practice.
Tasks
- Modify the existing
SimpleGreeting.javafile to print a greeting message to the console. - Compile the Java program using the appropriate command.
- Run the compiled program using the appropriate command.
Requirements
- Open the
SimpleGreeting.javafile located in the~/projectdirectory. - Use the
System.out.printlnstatement to print the greeting message "Hello, Java Programmer!". - Compile your program using the Java compiler in the terminal.
- Run your program using the Java runtime in the terminal.
- Ensure all work is done in the
~/projectdirectory.
Example
Expected output after running the program:
Hello, Java Programmer!

Summary
In this challenge, we focused on using the System.out.println statement in Java, building upon the basic concepts introduced in the lab. We modified a simple program to print a greeting message to the console, and then compiled and ran it. This challenge demonstrates the practical application of the print statement, which is a fundamental part of Java programming, and reinforces the compilation and execution process for Java programs.



