Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- interface IText
- {
- string ToText();
- }
- class Subtip : SubtitleFormat, IText
- {
- public int Error { get; set; }
- public Subtip(int error)
- {
- Error = error;
- }
- public string ToText()
- {
- return $"{Error}, Hello!";
- }
- }
- abstract class SubtitleFormat
- {
- protected int _errorCount = 1;
- public int ErrorCount
- {
- get
- {
- return _errorCount;
- }
- }
- }
- static void Main(string[] args)
- {
- SubtitleFormat sb = new Subtip(10);
- IText sb2 = sb as IText;
- Console.WriteLine(sb.ErrorCount);
- Console.WriteLine((sb as Subtip).Error);
- Console.WriteLine(sb2.ToText());
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement