Java Programming - ACT1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Java Programming

Activity 1
Task: Create a java program using Eclipse Luna, which display the word “HELLO WORD!”

Procedures
1. Open the Eclipse then set the destination of your project. Here I set it in Drive D in the folder
My Java Activity.

2. Wait for the Eclipse to open. Once the Eclipse is open click File then New then Java Project.

3. Now you will type the Project Name, Example Activity1 (Note: No space between words) then
click Next.
4. Here you can see your project name and the source (src) now click Finish.

5. After the Eclipse initiate the project you must expand the Activity1 and Right-click in the src the
click New then click Class.

6. Type the Name of your class, Example MyActivity1 then check the public static void
main(String[] args) then click Finish.
7. Now you can now enter code in your class project. So for the first activity we will print an
output and the words the we will print are “HELLO WORLD!”. So the code to print and output
word will be:
System.out.println("HELLO WORLD!");

So the whole code will be looks like this

public class MyActivity1 {

public static void main(String[] args) {


// TODO Auto-generated method stub
System.out.println("HELLO WORLD!");
}

}
8. Now we will run it by Right-click the Activity1 on the left side of the screen the Choose Run As
the Click 2. Java Application.

9. The save and launch option window will appear just click OK
10. You will see the result in the lower portion of the screen in the console, you will see the HELLO
WORLD! text printed on the console.

You might also like