Code: Select all
Shape
Ich bin nicht sicher, ob ich die richtige Terminologie verwende; Ich lerne C# seit etwas mehr als einem Monat, also verzeihen Sie mir, wenn ich es nicht tue.
Code: Select all
var shape = new Shape(); // shape = {Shape}
Shape circle = new Circle(); // circle [Shape] = {Circle}
Rectangle rectangle = new Rectangle(); // rectangle = {rectangle}
class Shape {}
class Circle : Shape {}
class Rectangle : Shape {}