-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabstract_inter.cs
40 lines (35 loc) · 1.1 KB
/
abstract_inter.cs
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
30
31
32
33
34
35
36
37
38
39
40
using System;
namespace Abstract
{
/// <summary>
/// ABSTRACT CLASS HAS TO PROVIDE IMPLEMEMNTATION FOR ALL THE MEMBERS INHERITED FROM THE BAASE CLASS
/// IF IT DOESNT PROVIDE IMPLEMENTATION FOR ALL THE ABSTARCT MEMBERS IT HAS TO BE DECLARED ABSTRACT AS WELL
/// ABSTARCT CLASSES CANNOT BE SEALED
/// IT CAN CONTAIN ABSTRACT MEMBERS BUT NOT MANDATORY
/// </summary>
//Abract classes can have implementation for some of its members but interfaces cannot have any
public abstract class Customer
{
//private by default
//can have implementation
//can inherite from interface and abstract class
public void Print()
{
Console.WriteLine("Print");
}
}
public interface ICustomer
{
//public by default
//cannot have implementation
//can inherite interfacess only not abstract class
//classes can inherit from multiple interfaces not abstract classes
void Print();
}
class Program
{
static void Main(string[] args)
{
}
}
}