Category Archives: C#

Interface in C# + abstract in C#

Interface always starts with I . It is the naming convention.

 

In a more basic way to explain: An interface is sort of like an empty muffin pan. It’s a class file with a set of method definitions that have no code.

An abstract class is the same thing, but not all functions need to be empty. Some can have code. It’s not strictly empty.

Why differentiate: There’s not much practical difference in Python, but on the planning level for a large project, it could be more common to talk about interfaces, since there’s no code. Especially if you’re working with Java programmers who are accustomed to the term.

shareimprove this answer

Example:

Explicit Interface Implementation:

 

Interface vs Abstract

 

 

Collection Initializer

codes:

 

C# Object Initializer

https://www.tutorialspoint.com/csharp_online_training/c_object_initializer.asp

 

 

Best:

From the best video and little bit mosh I have written the code below:

without object initializer:

 

with object initializer:

 

 

with object initializer:

 

 

 

 

Constructor in C#

code:

https://www.dotnetperls.com/constructor

 

https://www.tutorialspoint.com/csharp_online_training/c_constructors.asp

Extension Methods in C# 3.0

program.cs

StaticClass.cs

TestExtensionMethods.cs

 

 

 

 

 

 

 

output:

 

Gridview CRUD with Visual Studio

HTML 5 Template Creation With Visual Studio