Hello friends, I hope you all are doing great. In today's tutorial, we will discuss another important concept named Interface in C#. It's our 18th tutorial in C# series. It's one of my favorite concepts in C# as its come quite handy in complex projects.
Interfaces are quite similar to C# Classes & C# Structs in design so if you haven't studied those lectures then do read them first. So, let's get started with the Introduction to Interface in C#:
Introduction to Interface in C#
Interface in C# is created using Interface Keyword and is used for the declaration of Methods, Properties, Events etc. but we can't add any implementation in it. ( we can't declare Fields in Interface )
You can think of Interface as a signature, you look at the i ...
Hello friends, I hope you all are doing great. In today's tutorial, we will have a detailed Introduction to Structures in C#. It's our 17th tutorial in C# series. Structures are quite similar to classes but have few differences as well, which we will discuss today.
We have discussed C# Classes in 13th lecture, so you must read it once as we will use that knowledge in today's lecture as well. So, let's get started with Introduction to Structures in C#:
Introduction to Structures in C#
Structure in C# is a value type data type, created by using keyword struct, and can have fields, methods, properties, operators etc. just as in C# Classes.
Main difference between C# Class & Structure is that C# Class is a Reference Type Date type while C# St ...
Hello friends, I hope you all are having fun. In today's tutorial, we will have a look at Introduction to Polymorphism in C#. It's our 16th tutorial in C# series and polymorphism is considered as a main pillar of object oriented programming.
In our previous tutorial, we have seen a detailed Introduction to Inheritance in C# and along with it, we have also discussed How to hide a Method in Parent Class, if the same method exists in Child class. This Method Hiding is actually the basis of Polymorphism, so let's discuss it out in detail:
Introduction to Polymorphism in C#
Polymorphism in C# enables the user to invoke a Child Class Method & override the Parent Class Method, using a Parent Class Reference variable.
In our previous lecture o ...
Hello friends, I hope you all are having fun. In today's tutorial, we will have a detailed Introduction to Inheritance in C#. It's our 15th tutorial in C# series and again an important concept in Object Oriented Programming, as it helps in code optimization.
In our previous tutorial, we have discuss namespaces in C# and that was the last storage item in C#. Today, we are dealing with entirely different entity, which is inheritance. So, let's discuss it in detail:
Introduction to Inheritance in C#
Inheritance in C# is used to create a relation between two classes. In simple words, derived / child class is inherited from base / parent class and will automatically have all its members as its own. Inheritance is denoted by ( : ).
Mostly in pro ...
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to Namespaces in C#. Namespaces are considered as libraries in C#. If you have worked on any other programming language then you must be aware of the term library which contains all classes & methods etc. In C#, this functionality is performed by namespaces.
In 12th tutorial, we have seen Introduction to Methods and in 13th part, we have seen Classes in C#. Methods are simple storage units and stores code only, Classes are slightly bigger storage units and can store methods. Now Namespaces are giant storage units, which can save anything in them i.e. classes, methods, namespaces etc. So, let's have a look at them in detail:
Int ...
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to Classes in C#. It's my 13th tutorial in C# series and now we are ready to understand this slightly complex subject in C#.
In our previous tutorial, we have seen Introduction to Methods in C# which are used for organizing the code and we can add some code in separate methods to make the Main method simple. Classes are slightly bigger storage capacities than methods. Methods can store code, classes can store methods. So, let's discuss classes in detail:
Introduction to Classes in C#
Classes in C# are referred as storage units for different methods, fields, objects etc. and are used for organizing the code.
In our previous les ...
Hello friends, I hope you all are doing great. In today tutorial, I am going to give you a detailed Introduction to Methods in C#. It's our 12th tutorial in C# series. So far, we have covered all the basic concepts in C# and now it's time to move forward and have a look at some complex concepts.
Methods have an important role in C# programming and if you want to be an efficient programmer then you must set your method controls correctly. Some methods have secret codes in them, which you don't want to give access to your developers, then you can set it private. We will cover such things in detail later, let's first have a look at Introduction to Methods in C#:
Introduction to Methods in C#
Methods in C#, also called Functions, are extremely usef ...
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at How to use For Loop in C#. It's our 11th tutorial in C# series. Till now, we have seen two loops in C# which are IF Loop and while Loop and today we are gonna have a look at for Loop.
For Loop is most commonly used loop in any programming language and if you have worked on any other language then you must be aware of its syntax. It is used to create repeated loop with specified number. Let's have a look at it in detail:
How to use for Loop in C#
For loop in C# takes an integer variable as a Controlling agent, initialized at value V1 and ends at value V2, and the travel from value V1 to V2 depends on the Condition specified in () brackets.
In bot ...
Hello friends, I hope you all are great. Today, I am posting 10th tutorial in C# series and its about How to use while Loop in C#. It's gonna be a quick tutorial, as there's not much to discuss.
In our 8th tutorial in C# series, we have had a look at How to use IF Loop in C# and we have seen that IF loop takes a Boolean expression and if it's TRUE then it allows the compiler to enter in it just once. While loop is quite similar to IF loop as it takes a Boolean expression as well but it will keep on executing again & again, so let's have a look at it in detail:
How to use while Loop in C#
While Loop in C# takes a Boolean expression as a condition and it will keep on executing as long as the conditional expression returns true, we can say Exe ...
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at How to use switch Statement in C# and its our 9th tutorial in C# series. In our previous tutorial, we have seen IF Loop in C# and this switch statement is also a loop but works slightly different than IF loop and it totally depends on your application, which one you want to use.
First we will have a look at How to use switch statement in C# and after that we will also study goto statement, because switch and goto statements are normally used together. So, let's get started with it:
How to use switch Statement in C#
Switch Statement is a loop in C# which takes a variable as a condition, and then creates its different cases and we can deal each case se ...