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 the difference between a looping statement and a decision statement

4 Answers  


What are the limitation in using querystring in .net?

1 Answers   Tesco,


what is integration testing in real time applications?

0 Answers   CTS,


Write a program to reverse a number?

0 Answers   BirlaSoft,


what is the use of occurs 10 or (any number) in the internal table declaration with header line.

0 Answers  


I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution

0 Answers  


A good website has the following conditions It should be interactive. It should contain at least 20 images. Title cannot be null and should contain at least 10 letters other than spaces and hyphen (-). The keywords should contain atleast three among the following list : "design", "Graphics", "lovely", "beautiful", "amazing" and "mesmerising" Write a method: boolean isGoodWebsite(boolean isInteractive, int numOfImages, String title,String keywords[]) isInteractive whether the site is interactive or not numOfImages Number of images on the website title Title of the website keywords Array of keywords in the website.

0 Answers  


you have an unlimited supply of $3 and $7 poker chips. What is the largest integer value that you cannot make by combining different numbers of chips?

2 Answers  


What are the Short cut Keys of Tally ERP?

0 Answers  


Ordered List tag is

1 Answers  


What are the advantages of Server Controls over HTML/ASP Controls.

1 Answers   Tesco,


I am taking the bmc control m/enterprise manager 7.0 scheduling test and just wanted to see what kind of questions they would ask or if anyone has taken the test and how long it is for how many questions?

0 Answers  


Categories