Difference between revisions of "Java/C2/Hello-World-Program-in-Eclipse/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) |
|||
Line 17: | Line 17: | ||
| 00:20 | | 00:20 | ||
| To follow this tutorial you must have Eclipse installed on your system. | | To follow this tutorial you must have Eclipse installed on your system. | ||
− | |||
− | |||
|- | |- | ||
| 00:25 | | 00:25 | ||
| And you must know how to create, save and run a file in Eclipse. | | And you must know how to create, save and run a file in Eclipse. | ||
− | |||
− | |||
|- | |- | ||
Line 33: | Line 29: | ||
| 00:36 | | 00:36 | ||
| Here is a line of java code that prints the message '''Hello World''' | | Here is a line of java code that prints the message '''Hello World''' | ||
− | |||
− | |||
|- | |- | ||
Line 43: | Line 37: | ||
| 00:46 | | 00:46 | ||
| Press '''Alt''' ,'''F2''' and in the dialog box type '''eclipse''' and hit '''enter'''. | | Press '''Alt''' ,'''F2''' and in the dialog box type '''eclipse''' and hit '''enter'''. | ||
− | |||
− | |||
|- | |- | ||
Line 53: | Line 45: | ||
| 01:09 | | 01:09 | ||
| Now let us add a '''new project'''. | | Now let us add a '''new project'''. | ||
− | |||
− | |||
|- | |- | ||
| 01:12 | | 01:12 | ||
− | | click '''File''' | + | | click '''File''', '''New ''' and select '''Project ''' |
|- | |- | ||
Line 82: | Line 72: | ||
|- | |- | ||
|01:49 | |01:49 | ||
− | |Now let us add | + | |Now let us add a new class to the project. |
− | + | ||
|- | |- | ||
|01:52 | |01:52 | ||
− | |'''Right click''' on the ''' Project ''' '''New''' select '''Class'''. | + | |'''Right click''' on the ''' Project ''', '''New''' select '''Class'''. |
|- | |- | ||
Line 95: | Line 84: | ||
| 02:13 | | 02:13 | ||
| Click Finish at the bottom right corner of the wizard. | | Click Finish at the bottom right corner of the wizard. | ||
− | |||
|- | |- | ||
| 02:20 | | 02:20 | ||
− | | We can | + | | We can see that the''' DemoProject''' has the '''source directory''' and a file called '''Demo program.Java''', |
|- | |- | ||
|02:27 | |02:27 | ||
Line 138: | Line 126: | ||
|- | |- | ||
|03:43 | |03:43 | ||
− | |Out.println. In brackets in quotes type, '''HelloWorld''' | + | |'''Out.println'''. In brackets in quotes type, '''HelloWorld''' |
|- | |- | ||
|03:56 | |03:56 | ||
− | |In java,Every statement has to end with a semicolon. | + | |In java, Every statement has to end with a semicolon. |
|- | |- | ||
Line 158: | Line 146: | ||
|- | |- | ||
|04:11 | |04:11 | ||
− | |Right click '''Run as''' '''java application'''.'''Run''' the code | + | |Right click '''Run as''', '''java application'''.'''Run''' the code |
|- | |- | ||
Line 173: | Line 161: | ||
|- | |- | ||
− | |04: | + | |04:40 |
|As we can see, the message that is printed now is '''Hello Java''' | |As we can see, the message that is printed now is '''Hello Java''' | ||
Line 199: | Line 187: | ||
|- | |- | ||
|05:17 | |05:17 | ||
− | |In this tutorial we have learnt how to write a 'HelloWorld' program in java and also what each part of code does in java code. | + | |In this tutorial we have learnt, how to write a 'HelloWorld' program in java and also what each part of code does in java code. |
|- | |- | ||
Line 208: | Line 196: | ||
|05:29 | |05:29 | ||
| Create a java class by the name '''Greet''' it should bring '''Program Successful''' when executed. | | Create a java class by the name '''Greet''' it should bring '''Program Successful''' when executed. | ||
− | |||
− | |||
|- | |- | ||
Line 222: | Line 208: | ||
|05:42 | |05:42 | ||
| It summarises the Spoken Tutorial project | | It summarises the Spoken Tutorial project | ||
− | |||
|- | |- | ||
|05:45 | |05:45 | ||
| If you do not have good bandwidth, you can download and watch it | | If you do not have good bandwidth, you can download and watch it | ||
− | |||
|- | |- |
Revision as of 16:38, 22 August 2014
Time | Narration |
00:01 | Welcome to the spoken tutorial on HelloWorld in Java on Eclipse. |
00:06 | In this tutorial, we are going to learn, how to write a simple Hello Worldprogram in Java using Eclipse. |
00:13 | For this tutorial we are using Eclipse 3.7.0 and Ubuntu 11.10 |
00:20 | To follow this tutorial you must have Eclipse installed on your system. |
00:25 | And you must know how to create, save and run a file in Eclipse. |
00:30 | If not, for relevant tutorial please visit our website as shown. |
00:36 | Here is a line of java code that prints the message Hello World |
00:44 | Now let us try it on Eclipse. |
00:46 | Press Alt ,F2 and in the dialog box type eclipse and hit enter. |
00:56 | Click Ok at the workspace and here we have the Eclipse IDE. |
01:09 | Now let us add a new project. |
01:12 | click File, New and select Project |
01:19 | In the list of project select Java Project and click Next.
|
01:26 | In the project name ,Type DemoProject (please note that their is no space between Demo and ProjectD & P are in capital letters)
|
01:40 | Click Finish at the bottom right corner of the wizards. |
01:46 | DemoProject has been created. |
01:49 | Now let us add a new class to the project. |
01:52 | Right click on the Project , New select Class. |
01:59 | In the class name type DemoProgram and in the method stubs select one that says Public Static Void main. |
02:13 | Click Finish at the bottom right corner of the wizard. |
02:20 | We can see that the DemoProject has the source directory and a file called Demo program.Java, |
02:27 | This is because every class in Java has to be in its own file. Hence the class Demo Program can exist only in the file Demo program. Java |
02:40 | We can see that there is very little space for the editor and the view looks blurred . Let us minimise the other portlets and here we have the editor . |
02:55 | Notice that this line begins with two slashes which means this line is the comment and has nothing to do with our code. |
03:05 | Let us remove this line. Similarly every thing that is in between slash Astrix , and Astrix slash is also a comment
|
03:17 | So let us remove this comments also. |
03:22 | Here we have the bare bones of the code. |
03:27 | Now let us add the print statement, System.
|
03:35 | Notice that eclipse gives a list of all the possible completions. |
03:38 | For now we are going to type the command manually; |
03:43 | Out.println. In brackets in quotes type, HelloWorld |
03:56 | In java, Every statement has to end with a semicolon. |
03:59 | So let us add a semicolon. |
04:03 | Here these are complete HelloWorld program in Java. |
04:06 | Press Ctrl + S to save |
04:11 | Right click Run as, java application.Run the code |
04:19 | As we can see on the output console, the message HelloWorld has been printed. |
04:24 | Now let us change the World to Java |
04:30 | Save it with Ctrl + S and Run it. |
04:40 | As we can see, the message that is printed now is Hello Java |
04:45 | Now let us understand what each part of code does? |
04:48 | The first line indicates that the class name is DemoProgram and its a Public class |
04:55 | The second line indicates that this is the main method. In other words the method from which execution starts with java. |
05:04 | As we know this is a print statement. |
05:07 | And here is how we write a HelloWorld program in 'Java |
05:14 | This brings us to the end of the tutorial. |
05:17 | In this tutorial we have learnt, how to write a 'HelloWorld' program in java and also what each part of code does in java code. |
05:27 | As an assignment for this tutorial. |
05:29 | Create a java class by the name Greet it should bring Program Successful when executed. |
05:37 | To know more about the spoken-tutorial project. |
05:39 | Watch the video available at the following link.[1] |
05:42 | It summarises the Spoken Tutorial project |
05:45 | If you do not have good bandwidth, you can download and watch it |
05:51 | The Spoken Tutorial Team |
05:53 | Conducts workshops using spoken tutorials
|
05:55 | Gives certificates for those who pass an online test |
05:59 | For more details, please write to contact@spoken-tutorial.org |
06:05 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
06:09 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
06:14 | More information on this Mission is available at spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro |
06:19 | This tutorial has been contributed by TalentSprint. |
Contributors and Content Editors
Arya Ratish, Devraj, Gaurav, Kavita salve, Krupali, PoojaMoolya, Priyacst, Sandhya.np14, Sneha, Vasudeva ahitanal