Logo 
Search:

Interview FAQs

Submit Interview FAQ
Home » Interview FAQsRSS Feeds
C#
Comments: 0

Does C# support multiple inheritance (MI)?

No, though it does support implementation of multiple interfaces on a single class or struct.
Posted By:Cambria Lopez      Posted On: Oct 16

C#
Comments: 0

Is a C# interface the same as a C++ abstract class?

No, not quite. An abstract class in C++ cannot be instantiated, but it can (and often does) contain implementation code and/or data members. A C# interface cannot contain any implementation code or data members - it is simply a group of method names ...
Posted By:Topaz Ramirez      Posted On: Jan 06

C#
Comments: 0

Are C# constructors the same as C++ constructors?

Very similar, but there are some significant differences. First, C# supports constructor chaining. This means one constructor can call another:

class Person
{
public Person( string name, int age ) { ... }
public Person( ...
Posted By:Angie Bennett      Posted On: Sep 07

C#
Comments: 0

Are C# destructors the same as C++ destructors?

No. They look the same but they are very different. The C# destructor syntax (with the familiar ~ character) is just syntactic sugar for an override of the System.Object Finalize method. This Finalize method is called by the garbage collector when it...
Posted By:Ray Lawrence      Posted On: Dec 03

C#
Comments: 0

so an int is a value type, and a class is a reference type. How can int be derived from object?

It isn't, really. When an int is being used as an int, it is a value. However, when it is being used as an object, it is a reference to an integer value (on the managed heap). In other words, when you treat an int as an object, the runtime automatica...
Posted By:Emily Brown      Posted On: Dec 10

C#
Comments: 0

Are C# references the same as C++ references?

Not quite. The basic idea is the same, but one significant difference is that C# references can be null . So you cannot rely on a C# reference pointing to a valid object. In that respect a C# reference is more like a C++ pointer than a C++ reference....
Posted By:Jarrod Williams      Posted On: Sep 01

  42  43  44  45  46  47  48  49  50  51  52