Abstraction
Abstraction is the tactic of stripping an idea or object of its unnecessary accompaniments until you are left with its essential, minimal form. A good abstraction clears away unimportant details and allows you to focus and concentrate on the important details.
- Declare the abstract class, then use keyword abstract to define your abstraction methods
- Create a class, and conform to that abstraction
- Once conformed, use keyword override to implement for that abstraction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
public class Program { //abstract means that who ever extends this abstract //must implement the abstraction public abstract class university { //abstraction 1 public abstract void BTech(); } public class GBTU : university { public override void BTech() { Console.WriteLine("I am BTech"); } } public static void Main() { Console.WriteLine("Hello World"); GBTU g = new GBTU(); g.BTech(); } } |