Krishna Rajput Singh
What is Abstraction and types of Access Specifier and define?
By Krishna Rajput Singh in .NET on Jul 18 2014
  • Vinay Singh
    Jun, 2016 23

    •Abstraction is the process of providing the essential features of an object without providing its background details or explanation. •Classes use the concept of abstraction that is why classes are known as abstract data type.Access Specifier public access-specifier1. Public members are accessible in the class in which they defined and also accessible from anywhere outside the class, including classes derived from its base class.2.Private access specifer are accessible only inside their own class.3. Protected access-specifier are accessible in its own class and class derived from its base class. It plays a crucial role in the concept of inheritance. 4. internal access specifier are accessible classes of the same assembly. The variable or classes that are declared with internal can be access by any member within application.The default access specifier of class in C# is also internal.5.Protected internal access-specifier are accessible in the derived classes, its own class and also in the classes of its same assembly.

    • 0
  • Krishna Rajput Singh
    Jul, 2014 18

    Abstraction:"Abstraction is a process of hiding the implementation details and displaying the essential features.""Abstraction is a process that involves identifying the critical behavior of an object and eliminating irrelevant and complex details."Example1: A Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCD screen, wireless antenna, web camera, usb ports, battery, speakers etc. To use it, you don't need to know how internally LCD screens, keyboard, web camera, battery, wireless antenna, speaker's works. You just need to know how to operate the laptop by switching it on. Think about if you would have to call to the engineer who knows all internal details of the laptop before operating it. This would have highly expensive as well as not easy to use everywhere by everyone.So here the Laptop is an object that is designed to hide its complexity. How to abstract: - By using Access Specifiers.Net has five access SpecifiersPublic -- Accessible outside the class through object reference.Private -- Accessible inside the class only through member functions.Protected -- Just like private but Accessible in derived classes also through member functions.Internal -- Visible inside the assembly. Accessible through objects.Protected Internal -- Visible inside the assembly through objects and in derived classes outside the assembly through member functions.U follow me This website

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS