Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Example
- {
- // Abstract class
- abstract class Fmachine
- {
- public abstract void getData(string code, string name, int capacity);
- public abstract void putData();
- }
- class Airplane : Fmachine
- {
- private string code;
- private string name;
- private int capacity;
- public override void getData(string code, string name, int capacity)
- {
- this.code = code;
- this.name = name;
- this.capacity = capacity;
- }
- public override void putData()
- {
- Console.WriteLine($"Code : {code} \nName : {name} \nCapacity : {capacity}");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Airplane a = new Airplane();
- a.getData("AAx12V","Qatar Airways", 5000);
- a.putData();
- }
- }
- }
RAW Paste Data
Copied