Hellow World With Eclipse
To crate hello world java application , we will follow these steps : 1) download and install eclipse, 2) Create new project, 3) create new class and run it.
1) Download eclipse https://www.eclipse.org/downloads/packages/installer
2) Click on Windows x86_64
Eclipse Download Page
3) Click on download button
Eclipse Donload
4) After downloading open the file, Eclipse installer will open, select Eclipse for java developer
Select Eclipse for java developer
5) Select Java version and installation folder
Java and Installation folder
6) After complete installation click launch button
Lauch Eclipse
7) Select Workspace folder
Select Workspace Folder
8) Eclipse welcome screen will open
Eclipse Welcome screen
9) Click new java project, and enter project name HelloWorld
New Java project dialog
10) Click on finish
Click Finish
11) Create new class. Enter package name and class name
Create new class
12) Write code to print Hello World Java
Hello world code
13) Click on run button on top menu bar, it will display the output
Hello world output
Example Explanation
1) package com.rdm;
package is key word com.rdm is package name . Package is organizing classes related to a category. Each package is a folder in file system. ; semicolon is statement end character.
2) public class HelloWorld {
public is key word, access specifier keyword. it means class can be accessed from anywhere.
class is key keyword. indicate the HelloWorld is a class.
HelloWorld is class name, it should be same as file name. By java naming conventions it should start from capital letter, with camel case.
{ opening brace indicating class starting.
3) public static void main(String[] args) {
public is key word, access specifier keyword.
static is key word, static method can be accessed by class name.
void is key word. means that method not returning any value.
main main is method name.
(String[] args) method arguments list, here argument is arry of strings.
Note: public static void main(String[] args)is starting point for execution of java program.
{ opening brace indicating method starting.