Ans :

Value types can take either their normal values or a null value. Such types are called nullable types.

Int? UserID = null;
If(UserID.HasVAlue)
{
}

 

 

Ans :

Structs are value-type variables and classes are reference types. Structs stored on the stack, causes additional overhead but faster retrieval. Structs cannot be inherited.

 

 

Ans :

In C# Methods can be overloaded using different data types for parameter, different order of parameters, and different number of parameters.

 

Ans :

In C# method overriding, we change the method definition in the derived class that changes the method behavior. Method overloading is creating a method with the same name within the same class having different signatures.

 

Ans :

In C# Dispose() is called when we want for an object to release any unmanaged resources with them. On the other hand Finalize() is used for the same purpose but it doesn't assure the garbage collection of an object.

 

Ans :

In C# Interfaces have all the methods having only declaration but no definition. In an abstract class, we can have some concrete methods. In an interface class, all the methods are public. An abstract class may have private methods.

 

Ans :

In C# Protected Internal variables/methods are accessible within the same assembly and also from the classes that are derived from this parent class.

 

Ans :

In C# an array, we can have items of the same type only. The size of the array is fixed. An arraylist is similar to an array but it doesn't have a fixed size.

 

Ans :

In C# Method overloading is creating multiple methods with the same name with unique signatures in the same class. When we compile, the compiler uses overload resolution to determine the specific method to be invoke.

 

Ans :

In C# We create sealed classes when we want to restrict the class to be inherited. Sealed modifier used to prevent derivation from a class. If we forcefully specify a sealed class as base class then a compile-time error occurs.

 
Page 2 of 10