Show

Articles of level

Binding is the operation performed by the compiler to assign an object to a variable.
Early Binding is a means by which we assign an object to a variable of specific type so that the compiler knows before its execution about its type.This form of binding is the performance critical as it involves faster memory operations.When perform Early Binding, an object is assigned to a variable declared to be of a specific object type. Early binding objects are basically a strong type objects or static type objects. While Early Binding, methods, functions and properties which are detected and checked during compile time and perform other optimizations before an application executes. The biggest advantage of using early binding is for performance and ease of development.
In Late Binding,we do not use a specific type for a variable when an object is assigned to it. In Late binding functions, methods, variables and properties are detected and checked only at the run-time. It implies that the compiler does not know what kind of object or actual type of an object or which methods or properties an object contains until run time. The biggest advantages of Late binding is that the Objects of this type can hold references to any object, but lack many of the advantages of early-bound objects.

A pointer is a variable that stores a memory address. Every variable declared in a program has two components:

  1. Address of a variable
  2. Value stored in the variable
Pointer declarations use the * operator.
Syntax:
typename * variablename;
Example:
int i;        // declaration of a variable i
int *ptr;      // declaration of a pointer, called ptr

In C# you can use the sealed keyword in order to prevent a class from being inherited.

sealed class MyClass
{

}

Inheritance is the process of creating a new Class, called the Derived Class, from the existing class, called the Base Class. The Inheritance has many advantages, the most important of them being the reusability of code. Rather than developing new Objects from scratch, new code can be based on the work of other developers, adding only the new features that are needed. The reuse of existing classes saves time and effort.
However, inheritance may be implemented in different combinations in Object-Oriented Programming languages as illustrated in figure and they include:

  • Multi Level Inheritance
  • Hierarchical Inheritance
  • Hybrid Inheritance
  • Multipath inheritance
  • Multiple Inheritance

Casting is a way to convert values from one type to another. Mainly, two types of casting exist:

  • Implicit Casting
  • Explicit Casting

Extension methods are a feature new to C# 3.0 and allow you to extend existing types with your own methods. While they are static, they are used as if they are normal methods of the class being extended. Thus, new functionality can be added to an existing class without a need to change or recompile the class itself. However, since they are not directly part of the class, extensions cannot access private or protected methods, properties, or fields.

The singleton pattern instantiates only 1 object, and reuses this object for the entire lifetime of the process. This is useful, if you wish the object to maintain state, or if it takes lots of resources to set the object up. Below is a basic implementation:

Keywords:
Keywords are the reserved words used in programming. Each keywords has fixed meaning and that cannot be changed by user.For example:
int money;
Here, int is a keyword that indicates, money is of type integer. 
As, C# programming is case sensitive, all keywords must be written in lowercase. 

Identifiers:
In C# programming, identifiers are names given to C# entities, such as variables, functions, structures etc. Identifier are created to give unique name to C# entities to identify it during the execution of program. For example:
int money;
int mango_tree;

Here, money is a identifier which denotes a variable of type integer. Similarly, mango_tree is another identifier, which denotes another variable of type integer.

Finalizers

Finalizers are special methods that are automatically called by the GC before the object is collected. They can only be called by the GC provided they exist. The .NET ultimate base class Object has a Finalize method that can be overridden by child objects (anyone basically). The purpose of finalizers is to ensure all unmanaged resources the object may be using are properly cleaned up prior to the end of the object lifetime.
If a type has an implemented (overridden) finalizer at the time of collection, the GC will first put the object in the finalization queue, then call the finalizer and then the object is destroyed.Finalizers are not directly supported by C# compilers; instead you should use destructors using the ~ character, like so:

A virtual method is a method that can be redefined in derived classes. A virtual method has an implementation in a base class as well as derived the class. It is used when a methods basic functionality is the same but sometimes more functionality is needed in the derived class. A virtual method is created in the base class that can be overridden in the derived class. 

PreviousDisplaying 4 of 6Next
1 2 3 4 5 6
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*