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


Please Help Members By Posting Answers For Below Questions

What is a for loop in java?

599


Why java is call by value?

550


What is externalizable interface?

583


why are there separate wait and sleep methods? : Java thread

578


What is the main method java?

534






What does isempty () do in java?

607


How do you define a method?

514


What is meant by 'bit masking' in java?

649


How do you declare a destructor in java?

507


Using callable statement how can you pass out parameters, explain with example?

591


In java, how many ways you can take input from the console?

524


What are java packages?

586


What is private protected in java?

551


Is static a keyword in java?

527


What is difference between path and classpath in java?

487