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 object english?

581


Why collection doesn’t extend cloneable and serializable interfaces?

638


What is int argc char * argv?

562


Explain covariant method overriding in java.

538


What is purpose of keyword void?

556






What are different types of control structures?

487


Is sizeof a keyword in java programming?

599


Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls

1444


What is a numeric string?

559


Is c better than java?

539


What is collection class in java?

540


What data structures are used to perform recursion?

598


What do you mean by singleton class in java?

512


What are variable names?

524


describe synchronization in respect to multithreading? : Java thread

497