Skip to main content

Posts

Showing posts with the label C# OOPS Concept

C# OOPs Concepts

Encapsulation : Encapsulation is a process of binding the data members and member functions into a single unit. Example for encapsulation is class . A class can contain data structures and methods. Consider the following class public class Aperture { public Aperture () { } protected double height; protected double width; protected double thickness; public double get volume() { Double volume=height * width * thickness; if (volume return 0; return volume; } } In this example we encapsulate some data such as height, width, thickness and method Get Volume. Other methods or objects can interact with this object through methods that have public access modifier Abstraction: Abstraction is a process of hiding the implementation details and displaying the essential features. Example1 : A Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCD screen, wireless antenna, web camera, usb ports, batt...