1 | public class Hello { |
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.
EmoticonEmoticon