Java/C2/Programming-features-Eclipse/English
Author: TalentSprintScript Title: Programming Features of EclipseKeywords: Features of Eclipse, Eclipse IDE, auto completion, error dialog box, syntax highlighting, shortcut keys.
|
|
Slide 1Welcome | Welcome to the tutorial on Programming Features of Eclipse.
|
Slide 2Learning Objectives
|
In this tutorial, we will learn about
the user- friendly programming features of Eclipse
|
Slide 3Tools Used | For this tutorial we are usingUbuntu 11.0, JDK 1.6, and Eclipse 3.7.0 |
Slide 4Pre-requisites | To follow this tutorial, you must have
Eclipse must be installed in your system, and You must know how to write a simple java program in Eclipse.
|
Slide 5Programming Features Used in Eclipse IDE | Eclipse IDE supports many user friendly features such as
Auto completion, Syntax highlighting, Error dialog box, and Shortcut keys. We will look into each of these features in detail.
|
Switch to Eclipse IDE Interface(Auto completion)public class Features{ public static void main(string args[]) { {}} | I have created a class named Features and added the main method.
we will first look at the Auto completion feature in Eclipse.
|
Highlight main method
Hit Enter
|
Inside the main method type an opening brace and hitEnter.
|
Type ( inside the braces | It also completes every feature that works in pairs.
For example parentheses. type open parentheses
|
Type ) | Also note that if we are accustomed to type the closing parenthesis also, then it takes care of it by not adding the extra closing parenthesis.
|
Type “ inside the parentheses | It works in similar fashion with double quotes also.
|
Auto-completion is a very versatile feature and helps a lot in maintaining the structure of the code and also prevents typing errors like missing closing braces, missing closing parentheses and missing closing quotes. | |
Remove everything in the main function and type
System.out.println();
|
|
Point to the drop down list.** We can see the drop down list in the eclipse after the System. | Notice that Eclipse displays a drop-down list.
|
Select out and hit Enter.
|
Scroll down to out and press Enter.Again, type a dot. |
Point to the drop down list. | Now Eclipse will provide suggestions from the out module. |
Select println() and press Enter. | Scroll down to println() and press Enter.Now inside the paranthesis in quotes typeHello |
Eclipse IDE
|
next features we will looking at is the Syntax highlighting feature . |
Highlight class name
|
Note that the keyword public class, public static void are all in different color
Also note that the word Hello is in blue color indicating that this is the string. This Syntax highlighting feature helps us to differentiate between keywords and different parts of the code |
Eclipse IDEpublic class HelloWorld {public static void main(String args[]) { X System.out.println("Hello World")}}Remove the ;
|
Eclipse also helps the programmer to find out the errors. |
Point to the red cross. | In a program, an Error is denoted by a red cross symbol on the left margin. |
Hover the mouse over the red cross symbol. | in this program we can see their is an error and mouse hover on the error |
Point to the errors and solution. | We can see that the error says; semi-colon missing and the solution to resolve the error is also shown. |
Run it.
Point to the Error Dialog Box |
If we proceed to the run without fixing the error right click select run as java application
We have Error Dialog Box. indicating that their is an error asking should we proceed or not |
Click Proceed
|
For now let us proceed. We notice that their is output indicating that their is an error and when we go to problem console all the problem with possible solution are listed
So Let us resolve the error by adding a semi-colon. Ctrl S to save |
Keep the Eclipse IDE Window open. | The next programmer friendly feature of eclipse is the shortcut-keys. |
The common shortcut-keys in any program are Ctrl+S for saving and Ctrl+O for opening.
| |
Eclipse IDE
|
Control F11. is the shortcut for running the code. Let us try it now.Hold Ctrl and press F11 and we see that the code is run and the output Hello has been printed
|
Click Run and point to Debug | The shortcut keys for other options can be found by looking at the menu. Click Run
|
This is just a small but most commonly used list of the programming features of Eclipse. We shall look at more, in subsequent tutorials. | |
Slide 6Summary | this brings us to the end of this tutorial. In this tutorial, we learnt how to use programming features of Eclipse such as
Auto completion, Syntax highlighting, Error dialog box, and Shortcut keys, effectively. |
Slide 7
Assignment |
As an Assignment for this tutorial Write a simple Java program with a class that prints “Hello”
In the process Apply all the programming features of Eclipse. observe its functions |
Slide 8
Show About SlideAbout the Spoken Tutorial Project
|
To know more about the Spoken Tutorial project, watch the video available at the following link that summarizes the project.Alternatively, you can download and watch it. |
Slide 9
Show About SlideSpoken Tutorial WorkshopsThe Spoken Tutorial Project Team
|
The Spoken Tutorial Project Team:Conducts workshops using spoken tutorials.Gives certificates for those who pass an online test. For more details, please write to contact AT spoken HYPHEN tutorial DOT org. |
Slide 10
Acknowledgement
|
Spoken Tutorial Project is a part of the Talk to a Teacher project.It is supported by the National Mission on Education through ICT, MHRD, Government of India.More information on this Mission is available at spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro |
Slide 11About the contributor
Thanks for joining |
This tutorial has been contributed by TalentSprint. Thanks for joining. |