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

what is integration testing in real time applications?

0 Answers   CTS,


What is the language used for Artificial Intelligence?

1 Answers  


1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?

0 Answers   Accenture,


What is the GAC? What problem does it solve?

2 Answers  


THE CHANNEL IN DATA COMMUNICATION CAN BE?

0 Answers   TCS,






Write code to read the records from a file and load any array of size 99?make sure that you take care of all the error conditions?

0 Answers  


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box. eg: 3 box contain stick as:1,1,1. if u take 1 stick from 3rd numbred box you will any how win the match.

0 Answers   Manhattan,


Is strus threadsafe or not?

1 Answers  


how much fee for deccan soft institute .how to block seat for sandeep sir class reply soonnnn 

0 Answers  


cobol is execution r not without jcl

0 Answers   IBM,


Which design patterns have you used?

0 Answers  


Artficial language is provided which of the language?

3 Answers   Geometric Software,


Categories