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 for loop in java?
Why java is call by value?
What is externalizable interface?
why are there separate wait and sleep methods? : Java thread
What is the main method java?
What does isempty () do in java?
How do you define a method?
What is meant by 'bit masking' in java?
How do you declare a destructor in java?
Using callable statement how can you pass out parameters, explain with example?
In java, how many ways you can take input from the console?
What are java packages?
What is private protected in java?
Is static a keyword in java?
What is difference between path and classpath in java?