Difference between revisions of "Java/C2/Hello-World-Program-in-Eclipse/English"
(Created page with ''''Title of script''': HelloWorld in Java using Eclipse '''Author''': TalentSprint '''Keywords: '''HelloWorld, class, public, video tutorial {| style="border-spacing:0;" | s…') |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
'''Welcome''' | '''Welcome''' | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''HelloWorld in Java | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''HelloWorld in Java using Eclipse'''. |
|- | |- | ||
Line 21: | Line 21: | ||
'''Learning Outcomes''' | '''Learning Outcomes''' | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| In this tutorial, | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| In this tutorial, we are going to learn how to write a simple helloWorld program in '''Java '''using '''Eclipse.''' |
|- | |- | ||
Line 37: | Line 37: | ||
'''Pre-requisites''' | '''Pre-requisites''' | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| To follow this tutorial you must have Eclipse installed on your system. |
− | You | + | and You must know how to create, save and run a file on Eclipse. |
Line 52: | Line 52: | ||
System.out.println("Hello World"); | System.out.println("Hello World"); | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| Here is | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| Here is a line java code that prints the message '''Hello World''' |
− | Let us try | + | Now Let us try it on '''Eclipse'''. |
|- | |- | ||
Line 61: | Line 61: | ||
'''Alt + F2 > eclipse''' | '''Alt + F2 > eclipse''' | ||
− | | style="border:0.035cm solid #000000;padding:0.176cm;"| Press '''Alt''' and '''F2''' and | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Press '''Alt''' and '''F2''' and in the dialog box type eclipse and hit enter. Click Ok at the Workspace |
− | + | And here we have the Eclipse IDE. | |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Click on '''File > New > Project''' | | style="border:0.035cm solid #000000;padding:0.176cm;"| Click on '''File > New > Project''' | ||
− | | style="border:0.035cm solid #000000;padding:0.176cm;"| Now | + | | style="border:0.035cm solid #000000;padding:0.176cm;"|Now let us add a new project |
− | + | click '''File ''' '''New ''' and select '''Project ''' | |
|- | |- | ||
Line 78: | Line 78: | ||
Click''' Next''' | Click''' Next''' | ||
− | | style="border:0.035cm solid #000000;padding:0.176cm;"| Select '''Java Project | + | | style="border:0.035cm solid #000000;padding:0.176cm;"|In the list of project Select '''Java Project '''and click'''Next.''' |
Line 84: | Line 84: | ||
|- | |- | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| Type '''DemoProject''' | + | | style="border:0.035cm solid #000000;padding:0.097cm;"|In the project name Type '''DemoProject''' |
Click''' Finish''' | Click''' Finish''' | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| Type '''DemoProject ''' | + | | style="border:0.035cm solid #000000;padding:0.097cm;"|In the project name Type '''DemoProject''' |
+ | Please note that their is no space between '''Demo and Project ''' | ||
+ | '''D '''and '''P '' are in capital letters. | ||
− | |||
− | + | Click '''Finish''' at the bottom right corner of the wizards. The '''DemoProject''' has been created | |
− | Click | + | |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Point to the '''Project Explorer portlet''' on the left. | | style="border:0.035cm solid #000000;padding:0.176cm;"| Point to the '''Project Explorer portlet''' on the left. | ||
− | | style="border:0.035cm solid #000000;padding:0.176cm;"| Now '''Right click''' on the ''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"|Now let us add a new class to the project. '''Right click''' on the ''' Project ''' '''New''' select '''Class'''. |
− | + | ||
− | + | ||
Line 117: | Line 116: | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| In the class name type '''DemoProgram''' and in the method stubs select one that says''' Public, Static,Void main'''. Click Finish at the bottom right corner of the wizard. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | |||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Point to the '''src''' directory in '''Project Explorer Portlet''' | | style="border:0.035cm solid #000000;padding:0.176cm;"| Point to the '''src''' directory in '''Project Explorer Portlet''' | ||
− | | style="border:0.035cm solid #000000;padding:0.176cm;"| ''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| We can see that the''' DemoProject has the source directory and the Demo program.Java, This is because every class in Java has to be in its own file. Hence the class Demo Program can exit only in the file ''' Demo program. Java''' |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
Line 168: | Line 147: | ||
Press''' Ctrl + S''' | Press''' Ctrl + S''' | ||
− | | style="border:0.035cm solid #000000;padding:0.097cm;"| | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| We can see that their is very little space for editor and the view looks blurred er Let us minimise thr other portiere and here we have the editor . |
− | + | Notice that this line begins with two slashes which means this line is the comment and has nothing to do with our code. | |
− | + | Let us remove this line. Similarly every thing that is in between slash, Astrix and Mastic slash is also accompanied. | |
+ | |||
We will learn about all this once we get some output. | We will learn about all this once we get some output. | ||
Latest revision as of 00:21, 8 May 2013
Title of script: HelloWorld in Java using Eclipse
Author: TalentSprint
Keywords: HelloWorld, class, public, video tutorial
Visual Cue | Description |
Slide 1
Welcome |
Welcome to the spoken tutorial on HelloWorld in Java using Eclipse. |
Slide 2
Learning Outcomes |
In this tutorial, we are going to learn how to write a simple helloWorld program in Java using Eclipse. |
Slide 3
Tools Used |
For this tutorial we are using
Eclipse 3.7.0 and Ubuntu 11.10 |
Slide 4
Pre-requisites |
To follow this tutorial you must have Eclipse installed on your system.
and You must know how to create, save and run a file on Eclipse.
|
Slide 5
"HelloWorld"
|
Here is a line java code that prints the message Hello World
Now Let us try it on Eclipse. |
Minimize slides and launch Eclipse
Alt + F2 > eclipse |
Press Alt and F2 and in the dialog box type eclipse and hit enter. Click Ok at the Workspace
|
Click on File > New > Project | Now let us add a new project
click File New and select Project |
Select Java Project.
|
In the list of project Select Java Project and clickNext.
|
In the project name Type DemoProject
|
In the project name Type DemoProject
Please note that their is no space between Demo and Project 'D and P are in capital letters.
|
Point to the Project Explorer portlet on the left. | Now let us add a new class to the project. Right click on the Project New select Class.
|
Point to the New Java Class portlet
|
In the class name type DemoProgram and in the method stubs select one that says Public, Static,Void main. Click Finish at the bottom right corner of the wizard.
|
Point to the src directory in Project Explorer Portlet | We can see that the DemoProject has the source directory and the Demo program.Java, This is because every class in Java has to be in its own file. Hence the class Demo Program can exit only in the file Demo program. Java
|
Point to the “code editor”
After the line “public static void main”
|
We can see that their is very little space for editor and the view looks blurred er Let us minimise thr other portiere and here we have the editor .
Notice that this line begins with two slashes which means this line is the comment and has nothing to do with our code. Let us remove this line. Similarly every thing that is in between slash, Astrix and Mastic slash is also accompanied. We will learn about all this once we get some output.
|
Click on the code editor | Now let us compile and execute the program.
|
Point to output console at the botom of the code editor | The output message HelloWorld is displayed in the console window.
|
Replace HelloWorld with Hello Java and run the code. | Now, let us change the code to print a different message.
|
Point to the line public class DemoProgram
|
Now let us understand the program piece by piece.
|
Minimize the Eclipse window and switch to slides.
Summary |
We have come to the end of this tutorial.
We have also understood what each piece of the program does. |
Slide 7Assignment
|
Create a java class by the name Greet that prints Program Successful when executed. |
Slide 8About the Spoken Tutorial Project
|
To know more about the Spoken Tutorial project, watch the video available at the following link, that summarises the project.Alternatively, you can download and watch it. |
Slide 9Spoken Tutorial WorkshopsThe Spoken Tutorial Project Team
|
The Spoken Tutorial Project Team.
Conducts workshops using spoken tutorials.
|
Slide 10Acknowledgement
|
Spoken Tutorial Project is a part of the Talk to a Teacher project.
|
Slide 11About the contributor
|
This tutorial has been contributed by TalentSprint.
|