.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 >> OOPS >> Post New Question Subscribe to Interview Questions

Static methods can not use non static members. True or False.

Posted By :Abhisek Panda     Posted Date :December 29, 2009    Points :10   Category :OOPS 
True

You can also find related Interview Question to Static methods can not use non static members. True or False.  below: 

Static datamembers should be initialized inside the constructor. True or False.

  
False. Static datamembers should not be initialised inside constructor. (More...)

What is the use of static members in C#.NET?

  
The static members are the members which are not associated with a particular occurrence of any class. To implement this you have to use the keyword "static" before any member function. They can't access to non-static members as they are not associated with object instances. (More...)

What is the difference between static and instance methods

  
A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members.

A method declared without a static modifier is an instance method. An instance method operates on a specific instance and can access both static and instance members. The instance on which an instance method was invoked can be explicitly accessed as this. It is an error to refer to this in a static method.
(More...)

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...)

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...)

What is Static Constructor?

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

Web services can only be written in .NET, true or false?

  
False.

WebService can be written in Java,DotNet and some other languages. (More...)

DateTime variables can be null (True / False )

  
False

The DateTime type is a non-nullable value type, and just like an integer, it cannot be assigned to null. (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