Is it possible to implement an interface to a structure? Is
it possible to extend a struct? Is it possible to inherit a
class to struct?

Answers were Sorted based on User's Feedback



Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / sukriya

Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that
exactly as classes do.

Is it possible to extend a struct?
Ans: struct cannot extend another struct

Is it possible to inherit a class to struct?
Ans: A struct cannot inherit from another struct or class,

Is This Answer Correct ?    38 Yes 2 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / mangesh

Yes!! It is definately possible to implement interface to
structure.
struct structure_name: interface_name
{}
Structure cannot be extended.
Class cannot be inherited to structure

Is This Answer Correct ?    15 Yes 3 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / niraj sankar

yes!! a class or structure can implement from an interface
in C#.

Is This Answer Correct ?    14 Yes 4 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / sushil badyal

yes, We can implement interface in structure.
We can't extend structure also we can't inherit a class to
struct.

Is This Answer Correct ?    9 Yes 2 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / jay

just as a sum up for people that might get confused since
some obviously wrong answers are marked as YES:
answers #4,#5 and #6 are correct, 1,2,3 are wrong.

Is This Answer Correct ?    9 Yes 3 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / bablu

A struct type can implement an interface ya we can do that but the thing is we have to understand that struct is a value type and interface is a reference type data type so it is boxed.

Is This Answer Correct ?    0 Yes 1 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / rafi

it is not possible to implement interface to structure

Is This Answer Correct ?    13 Yes 20 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / sukriya

ans is no to all

Is This Answer Correct ?    3 Yes 19 No

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it p..

Answer / mukesh kumar

it is not possible to implement interface to structure as
interface does not support inheritance and structure ia
also value type.

Is This Answer Correct ?    3 Yes 21 No

Post New Answer

More C Sharp Interview Questions

Are all methods virtual in c#?

0 Answers  


Hai I am Shiva from TN, SSE.I have an query problem. My Table : Door Field : ID,DoorID,ZoneID,Date,Time,Status. Problem was : Status.We got two values, one is 00 (OUTTIME) , Another is 01(INTIME) Like this Status --------- 00 01 00 01 00 01 00 01 How to Set as Status 00 and 01 , of separate column , Status as Intime,Status as Outtime Like this ----------- InTime OutTime ---------- ----------- 01 00 01 00 01 00 01 00 01 00 01 00 Regards KS kumar

1 Answers  


What is difference between Trace and Debug

0 Answers   BirlaSoft,


How many variables do you need?

0 Answers  


What is the difference between namespace and class?

0 Answers  






What is multicast delegate explain with example?

0 Answers  


Is it not possible to store a boolean value as a variable?

0 Answers  


Compare and contrast between the System.Array.CopyTo() and Clone()?

0 Answers   Siebel,


Can you prevent your class from being inherited and becoming a base class for some other classes?

5 Answers  


Explain About namespaces

0 Answers  


What is application object in c#?

0 Answers  


Explain how do you debug an asp.net web application?

0 Answers  


Categories