why we use static with only main()class not with other class

Answers were Sorted based on User's Feedback



why we use static with only main()class not with other class..

Answer / nadeem khokhar

actually we never write main m = new main();
so with static function or class we do not have to declare a new memory, those are directly accessible. and definitely i can use static keyword with other classes but then i cant make an object of that class.

Is This Answer Correct ?    1 Yes 0 No

why we use static with only main()class not with other class..

Answer / boxofyuvi

Becoz the class which is stated as static will have the
first preference to execute....

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More Programming Languages AllOther Interview Questions

Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.

0 Answers   Amazon,


hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com

0 Answers  


1. What coding languages are you comfortable with?

1 Answers  


what are partial classes. Where is the entry point of partial classes.

1 Answers   Satyam,


what is session state?

0 Answers   HCL,






how many languages .net is supporting now?

2 Answers  


what is the last ant version you worked?how to get it

0 Answers  


What is Console Application? & The purpose Of Console Application? with description.

1 Answers  


swap two number wthout using third variable

4 Answers   eClerx,


Can we write a method in JSP.If so how?

0 Answers   HCL,


I am looking for selenium RC online Training in chennai. can any one tell me the best institute

0 Answers  


difference between mantis and other tools?

0 Answers  


Categories