Skip to main content

Posts

What is the difference between var and dynamic keywords? var is early binded dynamic is late binded . In order to understand the concept of early binding and late binding, let us check the below program- In the above program, we are using var keyword to assign string type of value to a variable. Since the variable is of type string, hence while trying to print the length of the string on console, we have to use Length property. When we try to do so, after typing a dot(.) after the variable "name", all the properties associated with the string variable are easily accessible along with the length property. Now, in all the above process where is early binding explained? Notice, the Length property of the string starts with  capital "L"  letter. If we try to use  small "l" , then the compiler will immediately show the error red line indicating that there is no property "length" that starts with small "l" for a  ...
Recent posts

Abstract Class and Interface

What is the difference between abstract class and interface? Abstract Class- Abstract classes can have implementation for some of its members. Abstract classes can have fields as its members. Abstract class can inherit from another abstract class or interface. Multiple inheritance is not possible in case of abstract class. Interfaces- Interfaces cannot have implementation for any of its members. Interfaces cannot have fields as its members. Interface can only inherit from another interface and not a class. Multiple inheritance is possible in case of interfaces.

Difference between DataAdapter and DataReader

What is the difference between DataAdapter and DataReader? DataAdapter- Disconnected Architecture. The time we call the data adapter, all the records are filled in the memory and we will be able to fetch the records even after the database connection is closed. DataReader- Connected Architecture. DataReader always need live database connection to fetch records from database.

Boxing and Unboxing in C#

What is  Boxing and Unboxing in .Net? Boxing- Conversion of value types to reference types. E.g.-                int i=1;                         object obj= i; Unboxing- Conversion of reference types to value types. E.g.-               int j= (int) obj; Basically we should avoid boxing and unboxing in practical implementation as it degrades the performance.