Posts

Showing posts with the label Inheritance
Image
Lambda expression in C# Lambda expressions in C# is nothing but simply can say that is the combination of delegate and anonymous methods, the “=>” operator is known as lambda operator which will be used for any kind of lambda expressions. Types of Lambda Expression: 1.      Expression Lambda:  combination of both input and the expression. 2.      Statement Lambda:  Combination of Both input and a Block of statements required for execution. pu Example,                                                                            ...
Image
Inheritance In C# What is Inheritance?                It’s a process of getting the members of one class from another class by using a relationship between parent and child concept. Class can have members, property or methods, same can be consumed in any of the class by inheriting them from the required class. This operation can be done without inheriting the parent class, but this will violate the OOPS advantage of re- usability because we must duplicate the code of parent to the required class. These are mainly derived from the Base library – “System” Class. Example, Skelton public Demo        {              Public void Display()       {            }                ...
Image
Attribute in c# An attribute is mainly derived from the library –  “System.Diagnostics”  but all the attributes were inherited from the Sealed class called Attribute this attribute class were basically implemented with the help of  “System.Relfection and System.Runtime.InteropServices”.  this will help to avoid writing complicated logic to validate the basic details and to restrict the operation to be performed with the properties/class/Methods. What is Attribute in c#? Attribute is used to provide a details information about a property or class or a method and even for structure behavior as well during the run time of an application execution (even for a console application). An Attribute is defined above a class or method or a property will define the functionality of that element. A attribute is defined by  square ([ ]) Brace  used above the required element. The .Net Framework supports 2 attributes types: 1.     ...
Garbage Collector in c# The garbage collector (GC) is mainly derived from the Base library –  “System”, we can simply say, I would like to Compare Garbage Collector with an Traffic Police Man, Because a Traffic Policeman will clear the traffic in the road, when an unwanted issue happening on a road and make road as hassle free road for the people, Like wise Garbage collector will act as Memory manger to deallocate the memory when it is consumed by unwanted or unused object in a program and make the application to run properly without any deviation in a performance. Generation of Garbage Collector: 1.       Generation 0 2.       Generation 1 3.       Generation 2 1.       Gen 0  è  (Temporary Variables) - Life time of object is short time, then Gen 0 Will take care of clearing and releasing the object from Memory. I.e. Simply we can say when it’s a local privat...
Image
Reflection   in C# The Reflection is mainly derived from the Base library –  “System.Reflection ”,  This reflection can be mainly used to specify the details such as meta data, In Other words, Reflection is used to provide the meta details of a property or a class or method. Suppose we have a class to be referred and need to access the object or a method from that class, in this case, we can go for reflection to access the property by providing the valid data about the property and can retrieve the value of the property in our calling class. It will throw error incase we have provided invalid property name or class name or simply the name of element at compile time, but it will throw exception in case of failure at the run time of the application. Example, AssemblyName                  è            Retrieve the unique name of an assembly EventInfo  ...
Image
Method Overloading   in C# The Method Overloading is defined as Defining More than One Method with the same Name or In Other words we can say that, contain Multiple Methods with the Same Name under the same Class. These Methods Are differentiated by the type of parameter or variating by the having more than one parameter But Changing of return type of Method is Invalid and Complier will throw error. Not a valid Method. These are mainly derived from the Base library –  “System” Class. Example, Here in This Example, Form1 Class Has Method –  “MethodOverLoadingDemo”,  And this Has been Overloaded with Multiple times as mentioned in the image. MethodOverLoadingDemo  à  Normal Private Method has been Defined. MethodOverLoadingDemo(string str= “MethodOverLoadingDemo”)  à   Overloaded the previous Method by String Parameter. MethodOverLoadingDemo(int MethodCount = 3)  à  Overloaded the previous Method by int Paramete...
Image
Method Overriding in C# The Method Overriding is defined as Defining More than One Method with the same Name under different Classes or In Other words we can say that, contain Multiple Methods with the Same Name using the concept of parent and Child Class relationship. The Method Overriding is the process of re-implementing the method defined in the parent class in the child Class These Methods are defined with the Modifier  VIRTUAL  in the parent Class and Overridden in the child Class with the Modifier  Override . We can Directly use method Definition of parent class or simply we can consume the method of parent in the child Class. When a Method is defined as  VIRTUAL  In a class then we are giving an Option to re- Implement the method in the child class or inherited Class or can be consumed directly without the re-implementation in the child Class. These are mainly derived from the Base library –  “System” Class. Example, Here in This...
Image
Abstract Class And Abstract Methods in C# The Abstract class is a class can contain both Abstract and Non-Abstract Method, to consume the non-Abstract method available in the abstract class then it is required or mandate to implement the abstract method of abstract Class. Abstract Methods  à  Defining the declaration of method I.e. Method without method body and the implementation of this method is available in the child class. Example, abstract   public   class   ParentClass // Parent Class          {              public   abstract   void  Display();              public   void  NormalMethod()              {               ...
Image
Interface in C# An Interface is a User Defined Type, and it will contain only the Abstract Method, it is required or mandate to implement the abstract method of Interface in the Child Class. In Other Words, it is defined as abstract method without abstract class. Abstract Methods  à  Defining the declaration of method I.e. Method without method body and the implementation of this method is available in the child class. Example, interface   IDemo // Interface         {               void  InterfaceDisplay(); // Declaring a method in Interface.                        void  InterfaceDisplay2(); // Declaring a method in Interface. } The process of implementing the method Declared in the Interface class will be implemented in the child Class. The...

Dot Net 360 -1 Hour Study = Gain 2 Year Experience

Hi Techieeeees, Here is your Booster/Sharper for all kind of Dot Net Related questions Posted and this is Basically Designed to train you from Zero to 2 Year Exp But all kind of Questions will be answered as much as possible.                                                                Our Team is full of Techiee Masters. Now we are going to cover topics basically used in c# to Sharpen your Knowledge. OOPS Concepts. Method Overloading Method Overriding Abstract Class And Abstract Methods Interface Inheritance Lamda Expression Indexer Attributes Reflection Var variables Dynamic Variables JIT CLR CLS CTS Enumeration Iqueryable IEnumerable Other C# Concepts Interview Questions for Dot Net                                ...