.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

Where does Static variables store ?

Posted By :Srikanth     Posted Date :April 21, 2011    Points :40   Category :C# 
Static variables are stored on the Heap of the memory. It is not dependent on whether it is declared within a reference type or a value type.

These variables will be in the memory till the time program ends.

You can also find related Interview Question to Where does Static variables store ?  below: 

Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?

  
(Class constructor method is also known as type constructor or type initializer)
Instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention. (More...)

Where do you store connection string?

  
Database connection string can be stored in the web config file.
The connection string can be stored in the WEB.Config file under
element. (More...)

Can you declare an override method to be static if the original method is not static?

  
No. The signature of the virtual method must remain the same.
(Note: Only the keyword virtual is changed to keyword override). (More...)

Is it possible to have a static indexer in C#?

  
No. Static indexers are not allowed in C#. (More...)

Are private class-level variables inherited?

  
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. (More...)

What is Static Constructor?

  
It is invoked when the instance of the class is created. (More...)

Are private class-level variables inherited?

  
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend