vijay channe
when destructor will call ?
By vijay channe in ASP.NET on Mar 27 2010
  • Sameeullah Daris
    Apr, 2010 3

    static is used to create only and only one copy of Method/ Variable (not all just but declared with  static keyword)  for all Objects.

    Normally wat happen that if you create Two objects of One Class A. Two instances ( copies) will be create seprately.

    Suppose you are making a Car Racing game .You created the Class for Car. now you Created  some Objects of car in the Race .

    Class Car

    {

    int Power,

    int Color;

    int MaxSpeed,

    int RaceTime;

    int RankOneTime;//

     

    }

     

    In this Scenrio the Race Time should be RankOneTime should be same for all the cars because its Time of First Ranked Car.

    so you should Declare is As Static.

    Class Car

    {

    int Power,

    int Color;

    int MaxSpeed,

    int RaceTime;

    static int RankOneTime;

     

    }

    • 0
  • Mohit Tyagi
    Apr, 2010 2

    There is no time in a C# program ,when destructor is called.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS