Welcome to Tech Altum C# Tutorial. In this tutorial we will first learn the fundamentals of object oriented like what is class and object, Constructor, Inheritance, Access Specifier, Abstract Class, Polymorphism, Generics, Collection, Grabage Collection etc with Practical example and Interview Questions.
Class is the way to realize real time entity in oops. It is the user defined data type.
Syntax of ClassConstructor
There are two types of constructor and these are following:-
Static Constructor(also known as class constructor)Constructor Type
If you ask the question that can we call constructor from another constructor then I will say yes we can. Calling constructor from another constructor is known as constructor chaining. This can be done by the keyword this and base. Here we discuss on this keyword and will discuss base keyword in the article constructor with inheritance.Constructor Chaining
We can give any suitable name to function but constructor name will be the name of class.Function v/s Constructor
Static Variable is also known as class variable. It is declared like a global variable. Static variable is called using class name. We cannot call static variable with objectstatic variable
We have two types of constructor. Static Constructor and Non Static Constructor. In this artical we have discussed the difference between static constructor and non static constructorstatic Constructor V/S Non Static Costructor
Inheritance is property of oops by which we access one class into another class without writing the whole code. The class that is inherited is called base class and the class that does the inheritance is called a derived classInheritance
When we inherit class into another class then object of base class is initialized first. If a class do not have any constructor then default constructor will be called.Base class constructor calling
Access specifier defines the accessibility of class member. We can restrict and limit the accessibility of member of classes.Access Specifier
At the time of overloading we generally use override with virtual. When we need to override the base class method into derived class than we use override keyword.Overried and New
Interface in C# is basically a contract in which we declare only signature. The class which implemented this interface will define these signatures. Interface is also a way to achieve runtime polymorphism. We can add method, event, properties and indexers in interfaceInterface
An Abstract class has been created using Abstract keyword while interface has been created using interface keyword.Difference between Abstract Class and Interface
Array in C sharp is basically continues memory allocation of given type and size. We create array by using .
int data = new int;Arrays
To search any element in array we use Contains Function. This function is declared and defined in Array class. We have to pass the value in this method. If this value available in the given array then it will return true and if not then it will return false.Array Searching
To search any element in array we use Contains Function. This function is declared and defined in Array class. We have to pass the value in this method. If this value available in the given array then it will return true and if not then it will return false.Array Merging
Jagged array is simply an array of arrays. As we define 2-d array in which each column for each rows are same. But in case of jagged array we can define different column for each rows.Jagged Array
Before understanding the operator overloading we need to understand why we use operator overloading. In the following example we have one class calculator which contains two variable x and y. and one web form where we create two variables in its cs file and add them.Operator Overloading
In simple term collection in C# is a way to store objects. We use System.Collection namespace to work with collection.IEnumerable and IEnumerator