First Java Program using Eclipse

Price: INR 8,499.00
Was: INR 8,999.00
Price: INR 13,999.00
Was: INR 14,999.00

Let’s take an example of First Java program to understand structure and features of the class. This is a small program, and its only task is to print “Welcome to EasyBix !!!” on the screen.

Package – It is the first statement in the Java program. In our example “com.EasyBix.CoreJava”  is our package. The package statement defines a namespace in which classes are stored. The package is used to organize the classes/modules based on functionality. If you don’t declare the package, the class names are put into the default package, which has no name.



Class – The Second statement in the program should be class. The class name should be followed by access modifier, access modifiers can be public, protected, private or default (no value). Our class is “FirstProgram”.

Method – Method is function or event for which we are designing the class. Method name should follow by access modifier and return type. In our example “displayMessage()” is our method.

Main() method – Its method (Function) named main with string array as the argument. Here public is Access Modifier, static is reserved keyword which means that a method is accessible and usable even though no objects of the class exist, the void is keyword declares nothing would be returned from a method.

Main() a method is necessary to run the program. 


Selenium Video Tutorial:

If you liked this video, then please subscribe to our YouTube Channel for more video tutorials.


0 Comment

Leave a Reply