using System;
using System.Linq;
namespace ConsoleApplication1
{
internal class Program
{
public static void Main(string[] args)
{
var p1 = new Product();
var p2 = new Product(7568658965498749, "Gin");
var p3 = new Product(5469836938744987, "Jija", "Jojo");
p1.Display();
p2.Display();
p3.Display();
}
}
class Product
{
private long Id { get; }
private string ProductName { get; }
private string SupplierName { get; }
public void Display()
{
Console.WriteLine($"Id is {Id}");
Console.WriteLine($"ProductName is {ProductName}");
Console.WriteLine($"SupplierName is {SupplierName}");
}
public Product(long id, string productName, string supplierName)
{
Id = id;
ProductName = productName;
SupplierName = supplierName;
}
public Product(long id, string supplierName)
{
Id = id;
ProductName = "Nivas";
SupplierName = supplierName;
}
public Product()
{
Id = 0;
ProductName = "";
SupplierName = "";
}
}
}
Comments
Leave a comment