Skip to main content

Posts

Showing posts with the label .Net Interview Questions

Dotnet Interview Question

1. What is Property? A property is a member that provides a flexible mechanism to read, write, or compute the value of a private field. Properties can be used as if they are public data members, but they are actually special methods called accessors . This enables data to be accessed easily and still helps promote the safety and flexibility of methods. Example: class TimePeriod { private   double seconds; public   double Hours { get { return seconds / 3600; } set { seconds = value * 3600; } } }   2. What is the difference between abstraction and encapsulation? Abstraction: Abstraction lets you focus on what the object does instead of how it does it That means we use the object without knowing the source code of the class. Encapsulation: Encapsulation means hiding the internal details or mechanics of how an object does something. Encapsulation is warping data into single unit. 3. What is the difference between c...