Hello Java program

In this post we will learn about Hello Java program and try to understand with example.

1
2
3
 public class Hello {

}

Like other programming language Java programs also have keywords. Each keywords has specific meaning and sometime used in some specific orders. keywords are case sensitive like public and Public and even PUBLIC all are totally different.

With the help of keywords and certain rule we can write statements which collectively form java program.

In the above program you can see public and class are two keywords in green and Hello is the name of the class. lets try to understand the meaning of both keywords.

public :- In java programming public is the access modifier is allow us to define the scope or you can also say how other part of the program access this code. For example  public bus that means it is available for everyone i.e scope is for everyone. So here our class is public means available for every other class.

class :- To define a class we need the class keywords. In above example Hello is the class name and defined using class keyword and whatever you can write withing both left and right curly braces are called as class body.  


 

Share this

Related Posts

Previous
Next Post »