Sample

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SOLID_Principles { class Rectangle { public double SideA { get; } public double SideB { get { return SideB; } set { SideB = value + 10.0d; } } public Rectangle(double sA, double sB) { SideA = sA; SideB = sB; } } struct StructRectangle { public double SideA { get; } public double SideB { get { return SideB; } set { SideB = value + 10.0d; } } public StructRectangle(double sA, double sB) { SideA = sA; SideB = sB; } } class Program { static void Main(string[] args) { Rectangle rect = new Rectangle(5.0, 10.0); StructRectangle rect2 = new StructRectangle(5.0, 10.0); StructRectangle rect3 = new StructRectangle(); } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.