Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
namespace CoreyAbstractClassHW
{
class Program
{
static void Main(string[] args)
{
Pliers pliers = new Pliers
{
PliersType = "Needle nose",
SerialNumber = "201ef3",
Manufacturer = "Channel Lock"
};
Console.WriteLine($"The product is a {pliers.PliersType} pliers the serial number is \n" +
$"{pliers.SerialNumber} and the manufacturer is {pliers.Manufacturer}");
Console.ReadLine();
}
}
public interface IProductData
{
string SerialNumber { get; set; }
string Manufacturer { get; set; }
}
public abstract class HomeImprovement : IProductData
{
public abstract string SerialNumber { get; set; }
public abstract string Manufacturer { get; set; }
}
public class Pliers : HomeImprovement
{
public string PliersType { get; set; }
public override string SerialNumber { get; set; }
public override string Manufacturer { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.