-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
81 lines (56 loc) · 1.48 KB
/
Program.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections.Generic;
namespace FaceClon
{
abstract class Publicacion
{
protected string comentario;
protected string reacciones;
protected int fecha;
public Publicacion(int fecha,string reacciones,string comentario)
{
this.fecha=fecha;
this.reacciones=reacciones;
this.comentario=comentario;
}
public abstract void Imprime();
}
class Estado:Publicacion
{
public Estado(int fecha,string reaccion,string comentario):base(fecha,reaccion,comentario)
{
}
public override void Imprime()
{
Console.WriteLine("Se publico un estado el {0} del mes,recibio de reaccion {1},y comentaron {2} ", fecha,reacciones,comentario);
}
}
class Foto:Publicacion
{
protected string fotografia;
public Foto(string fotografia,int fecha,string reaccion,string comentario):base(fecha,reaccion,comentario)
{
this.fotografia=fotografia;
}
public override void Imprime()
{
Console.WriteLine("Se publico una {0} el {1} del mes,recibio de reaccion {2} ,y comentaron {3} ", fotografia,fecha,reacciones,comentario);
}
}
/*class Link:Publicacion
{
} */
class Program
{
static void Main(string[] args)
{
List<Publicacion> Accion =new List<Publicacion>();
Accion.Add(new Estado(22,"like","hola"));
Accion.Add(new Foto("foto",14,"me encanta","hola"));
foreach(Publicacion a in Accion)
{
a.Imprime();
}
}
}
}