Problem

Your First Java ProgramThis assignment will help you get acquainted with your Java develop...

Your First Java Program

This assignment will help you get acquainted with your Java development software. Here is the Java program you will enter:

// This is my first Java program.public class MyFirstProgram{public static void main(String[] args) { System.out.println(“Hello World!”); }}

If You Are Using the Sun JDK:

1. Use a text editor to type the source code exactly as it is shown. Be sure to place all the punctuation characters and be careful to match the case of the letters as they are shown. Save it to a file named MyFirstProgram.java.

2. After saving the program, go to your operating system’s command prompt and change your current directory or folder to the one that contains the Java program you just created. Then use the following command to compile the program:

javac MyFirstProgram.java

If you typed the contents of the file exactly as shown, you shouldn’t have any syntax errors. If you see error messages, open the file in the editor and compare your code to that shown. Correct any mistakes you have made, save the file, and run the compiler again. If you see no error messages, the file was successfully compiled.

3. Next, enter the following command to run the program:

java MyFirstProgram

Be sure to use the capitalization of MyFirstProgram exactly as it is shown here. You should see the message “Hello World!” displayed on the screen.

If You Are Using an IDE:

Because there are many Java IDEs, we cannot include specific instructions for all of these. The following are general steps that should apply to most of them. You will need to consult your IDE’s documentation for specific instructions.

1. Start your Java IDE and perform any necessary setup operations, such as starting a new project and creating a new Java source file.

2. Use the IDE’s text editor to type the source code exactly as it is shown. Be sure to place all the punctuation characters and be careful to match the case of the letters as they are shown. Save it to a file named MyFirstProgram.java.

3. After saving the program, use your IDE’s command to compile the program. If you typed the contents of the file exactly as shown, you shouldn’t have any syntax errors. If you see error messages, compare your code to that shown. Correct any mistakes you have made, save the file, and run the compiler again. If you see no error messages, the file was successfully compiled.

Use your IDE’s command to run the program. You should see the message “Hello World!” displayed.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT