Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Thursday, 13 August 2015

Abstraction in C# with example

 No comments   


Abstraction is one of the principle of object oriented programming. It is used to display only necessary and essential features of an object to outside the world.Means displaying what is necessary and encapsulate the unnecessary things to outside the world.Hiding can be achieved by using "private" access modifiers.
We can not create object of an Abstract class we only create reference variable of it thats why abstract class must be inherited by any derived class which want to use the functionality of abstract methods.

Note - Outside the world means when we use reference of object then it will show only necessary methods and properties and hide methods which are not necessary.

We can take an example of an car. We can see the wheels, engine and can hear the horn of an car but we don't know that how they are working. because their internal mechanism is hidden from us we only know that it is working but how we don't know it is type of abstraction.

When we declare any method of a class as abstract then the class becomes Abstract class.
When derived class inherited with abstract class; derived class must be override abstract class methods.

Impementation of Abstarction:


Output:
Galgotiya BTech Fee 50000/-
Galgotiya MBA Fee 100000/-
LPU BTech Fee 40000/-
LPU MBA Fee 800000/-
Explanation :-
 From above example we have make one abstract class university and two abstract methods Btech and MBA. Galgotiya and LPU both are override university course fee.
University course common for both Galgotiya and LPU so university method BTech and MBA is abstract.
 Galgotiya and LPU inherited abstract method so university method must be override here.

Pure Abstract Class:

When a abstract class have all their method as abstract then the class known as Pure Abstract Class.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home

0 comments:

Post a comment

Facebook Updates

Guruji Point

Popular Posts

  • Base64 Encoding And Decoding In SQL Server
    Introduction In this article we will learn How to encode a string into Base64String and how to decode Base64String to string. How to crea...
  • Trigger In SQL Server - Insert Update Delete In Single Trigger With Example
    Introduction In this article we will learn what is trigger . How to manage Insert, Update and Delete operation in trigger. Insert Update ...
  • Convert DataSet To List Or GenericList Using LINQ - C#
    Introduction In this article we will learn how to convert dataset to list or convert DataSet to List of collection o generic list in c#. ...
  • Difference Between DataAdapter And DataReader In Asp.Net With Example
    Introduction In this article we will learn what is DataAdapter and DataReader. What is the difference between dataadapter and datareader....
  • Read List With In List Collection Using LINQ - Increase Application Data Performances
    Introduction In this article we will learn about how to read data from a SubList or list with in list collection. How to access sub list p...

Categories

comma seperated string in sql Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS row_number() and dense_rank() salary table structure. Scope_Identity() Use of indexes while loop in sql why do we need cursor why tuple used

Best Deal Here

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write