c# 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#:
- Title
- c# access session in class
- Category
- C#
- Title
- rotate to face direction
- Category
- C#
- Title
- attribute usage c#
- Category
- C#
- Title
- c# quick "is" "as"
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- using mediamanager how to play mp3 files
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- c# bitmap to array byte
- Category
- C#
- Title
- c# datatable copy selected rows to another table
- Category
- C#
- Title
- unity onselect gizmos wireframe
- Category
- C#
- Title
- windows forms iterate through all controls
- Category
- C#
- Title
- set current date to textbox in asp.net
- Category
- C#
- Title
- c# loop through list
- Category
- C#
- Title
- unity add component
- Category
- C#
- Title
- how to add to an array c#
- Category
- C#
- Title
- month number to text in c#
- Category
- C#
- Title
- c# new list object
- Category
- C#
- Title
- how to convert object in string JSON c#
- Category
- C#
- Title
- bash if null or empty
- Category
- C#
- Title
- c# property get set
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- get hash c#
- Category
- C#
- Title
- c# linq select specific columns
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- unity how to get y value
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- asp textarea
- Category
- C#
- Title
- convert string to boolean c#
- Category
- C#
- Title
- cshtml foreach
- Category
- C#
- Title
- unity gameobject.find
- Category
- C#
- Title
- unity how to get data of play session time in a text file?
- Category
- C#
- Title
- c# delay
- Category
- C#
- Title
- unity set position
- Category
- C#
- Title
- get attribute value of xml element c#
- Category
- C#
- Title
- set decimal point c#
- Category
- C#
- Title
- linq c# where condition
- Category
- C#
- Title
- parsing object from text file c#
- Category
- C#
- Title
- ignore fakeiteasy
- Category
- C#
- Title
- C# Cast double to float
- Category
- C#
- Title
- membership get user id
- Category
- C#
- Title
- how to say or in c#
- Category
- C#
- Title
- serilog loglevel order
- Category
- C#
- Title
- or symbol in unity
- Category
- C#
- Title
- how to find the type of a object c#
- Category
- C#
- Title
- move to where it facing unity 2d
- Category
- C#
- Title
- change text color wpf
- Category
- C#
- Title
- c# merge two xml files
- Category
- C#
- Title
- c# unhandled exception in thread
- Category
- C#
- Title
- c# System.Resources.MissingManifestResourceException error
- Category
- C#
- Title
- c# loop through object
- Category
- C#
- Title
- unity rigidbody addforce
- Category
- C#
- Title
- c# aspx return image
- Category
- C#
- Title
- c# how to refresh your binding source
- Category
- C#
- Title
- datagridview select row column cell c#
- Category
- C#
- Title
- prompt for array unity c# editor scripting
- Category
- C#
- Title
- how to make an array in csharp
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- unity instantiate
- Category
- C#
- Title
- c# create a text file
- Category
- C#
- Title
- Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress
- Category
- C#
- Title
- isprime c#
- Category
- C#
- Title
- set int to null c#
- Category
- C#
- Title
- waitforseconds unity
- Category
- C#
- Title
- convert string to decimal c#
- Category
- C#
- Title
- vb.net drag window without titlebar
- Category
- C#
- Title
- how to add a componet to a gameobject throgh code unity
- Category
- C#
- Title
- c# two dimensional array
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- convert number of days into months c#
- Category
- C#
- Title
- eager loading vs lazy loading c#
- Category
- C#
- Title
- play sound on collision unity c#
- Category
- C#
- Title
- message uwp c#
- Category
- C#
- Title
- what is using static in c#
- Category
- C#
- Title
- generics in c#
- Category
- C#
- Title
- unity instantiate vector3
- Category
- C#
- Title
- x angle oes back after 90 unity
- Category
- C#
- Title
- c# listview
- Category
- C#
- Title
- convert string to datetime c#
- Category
- C#
- Title
- c# remove last character from string
- Category
- C#
- Title
- usermanager change password without current password
- Category
- C#
- Title
- set rotation to velocity unity
- Category
- C#
- Title
- unity change text color
- Category
- C#
- Title
- how to change player cursor c# script unity
- Category
- C#
- Title
- c# string to character array
- Category
- C#
- Title
- dynamic in c#
- Category
- C#
- Title
- count number of enum values C#
- Category
- C#
- Title
- How to search for a string from readline in c#
- Category
- C#
- Title
- c# silent execute exe
- Category
- C#
- Title
- gfortran: declare an array
- Category
- C#
- Title
- c# string replace comma with newline
- Category
- C#
- Title
- f string C#
- Category
- C#
- Title
- c# code to convert decimal to binary
- Category
- C#
- Title
- beard styles without mustache Intitle:work with me
- Category
- C#
- Title
- wpf make size fill all grid
- Category
- C#
- Title
- unity print to console
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- asp.net core mvc not triggering client side validation
- Category
- C#
- Title
- c# public static string
- Category
- C#
- Title
- get first and last item list c#
- Category
- C#