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 the difference between numeric and integer?
Can we override tostring method in java?
Can an interface extend another interface?
What is substring 1 in java?
What is a Null object?
why are there separate wait and sleep methods? : Java thread
Is string serializable in java?
Why webdriver is an interface?
What is boolean used for?
Explain about method local inner classes or local inner classes in java?
What is difference between this and super keyword?
Why string is immutable or final in java
What does split function do in java?
What is the difference between access specifiers and access modifiers in java? 16
State differences between C and Java?