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 16 bits called?
Can we create an object of static class in java?
What are the two types of java?
What is use of map in java?
Which language is java?
What is a package in java? List down various advantages of packages.
What is constructor and virtual function? Can we call a virtual function in a constructor?
What does index mean in java?
What is an object in java and how is it created?
What are the new features in java 8?
What is int short for?
What is another word for methodology?
What are facelets templates?
Can vector have duplicates in java?
How many types of literals are there in JAVA?