Example 1: Implementation of C# method overloading (static polymorphism)
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run Area of Rectangle 50 Area of Rectangle 31.400000000000002 kodingwindow@kw:~/csharp$
Example 2: Implementation of C# method overloading
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run Area of Square 100 Area of Rectangle 31.400000000000002 kodingwindow@kw:~/csharp$
What Next?
How to overload the Main() method in C#
Implementation of C# method overriding
C# program for complex numbers operations
Advertisement