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 function overloading in java?
Why java is secure? Explain.
What is a stringbuffer?
Why method overriding is used?
Which collection is ordered in java?
What is multithreading and its advantages?
What is anti pattern in java?
Why null value is used in string?
Can you override static methods?
When is the finalize() called? What is the purpose of finalization?
What does || mean in vectors?
Is array passed by reference in java?
Can list be null in java?
what is synchronization? : Java thread
What does %d do in java?