Need to use public,static keywords in main function?
Answer Posted / psreddy
public access modifier we declared then that class visible
to every where and access to any where
bcoz if we write any number business logic classes but
we have to write only one execution logic class for all
these business logic classes
that is why always execution logic class as public
and also there is need of writing static key word
bcoz the execution logic executes only once
other wise we will get runtime exeption
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is a constructor overloading in java?
When do we use synchronized blocks and advantages of using synchronized blocks?
What is final keyword in java? Give an example.
How do you take thread dump in java?
What does a boolean method return?
Which package has light weight components in java programming?
Can inner class have constructor?
What is the method in java?
How does hashset work in java?
What are peerless components in java programming?
What type of variable is gender?
What is an object class?
What are the main uses of the super keyword?
Similarity and difference between static block and static method ?
How is Object Oriented Programming different from Procedure Oriented Programming?