abstract class c#
abstract class Shape
{
public abstract int GetArea();
}
class Square : Shape
{
int side;
public Square(int n) => side = n;
// GetArea method is required to avoid a compile-time error.
public override int GetArea() => side * side;
static void Main()
{
var sq = new Square(12);
Console.WriteLine($"Area of the square = {sq.GetArea()}");
}
}
// Output: Area of the square = 144
Also in C#:
- how to convert object in string JSON c#
- .net core session
- unity fall damage c#
- asp.net list all files in folder
- Assets\playermove.cs(30,37): error CS1003: Syntax error, ',' expected
- c# asp.net hover tooltip
- wpf label text in center
- unity t-flip flop
- onmouseover unity
- query into complex object using dapper
- c# how to initialize an array
- decalre an int list mvc
- chase object unity
- how to join array indexes with comma in c#
- how do i foreach c#
- redirect to https codeigniter
- 2d object look at object
- c# graphics draw filled rectangle
- const float c#
- unity rotation
- C# get pc language
- c# int
- c# Authorization has been denied for this request
- c# datafield change cell background color