Eclipse IDE Installation (Continuation)
Double Click the Application file to launch Eclipse IDE and specify Workspace path
Pin the Application file to the Task Bar
Java Project Creation & Execution
The below are the steps for creating a Java Project in Eclipse IDE:
Right click in the 'Project Explorer' and select 'New > Project > Java Project'
Provide 'Project Name' and click on 'Finish' button
Right click on the 'src' folder and select 'New > Class'
Provide 'Class Name', select the checkbox for main method and click on 'Finish' button
Write a sample Java statement - System.out.println("Hello World!");
Right click on the .java file and select 'Run As > Java Application' to execute the Java program
Understanding Java Programs
In Java programs, we have to enclose everything inside a Class.
Syntax: public class ClassName { }
This class term is used as syntax to create/define a Class in Java
In Java programs, execution starts from the main method
Syntax of main() method - public static void main(String args[]){ }
All the Java statements in Java should end with ';' symbol
Example for a Java Statement is nothing but print statement - System.out.println("Hello World");
All the Java statements should be written inside the methods
We generally write code which is nothing but a set of statements inside the methods
Keywords like public, static, void and String args[] will be explained later
Compiler Errors
Java Complier Errors will be displayed when we make syntax mistakes in the Java Code:
Example: All the Java statements in Java should end with ';' symbol
Remove the ; from the end of Java Statement
Example: Java is case sensitive
Replace 'S' with 's' in the statement
Example: Remove any of the closing brace