Is interface is value type or Reference type?
Any one Know give me small example.
Thanks inadvance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Oct 27, 2011, 11:28 AM
Of course, if you call the GetType() method - which all types inherit from System.Object - this gives you the runtime type of the object (i.e. what it really is) rather than its compile time type.
Javeed M ShaikhPosted Oct 27, 2011, 9:17 AM
VulpesPosted Oct 27, 2011, 4:32 AM
Although it may appear to act like a value type when you assign a struct to a variable of the interface type, in fact the struct is boxed on the heap and a reference to it is then assigned to the interface variable.
See this previous thread where exactly the same question was asked:
http://www.c-sharpcorner.com/Forums/Thread/144641/c-sharp-interface.aspx
TulasiPosted Oct 27, 2011, 1:47 AM
Interface is both(value type and reference type) .
lets see one example
public interface ITest
}
Please mark the answer as Accepted if it helps you.