What is the difference between ref and out parameters in C#?

ref and out parameters are quite similar in their meaning. ref and out keywords are used to pass parameters to a method by reference. By default parameters are being passed to methods by value. Passing reference to variable instead of value means referenced variable might (or must) be modified/assigned by the method accepting this reference. The main difference is out parameters must be set during the execution of the method and ref parameters are not required to be set before returning. But there is more.

Tools of encapsulation in C#, access modifiers in C#

Encapsulation, in the context of C#, refers to an object's ability to hide data and behavior that are not necessary to its user. Encapsulation is used to restrict access to the members of a class so as to prevent the user of a given class from manipulating objects in ways that are not intended by the designer.

What is attribute in C#?

Basically, attribute is an information (metadata) that can be attached to your method, class, namespace, assembly etc. Once associated with a program entity, the metadata provided by an attribute can be queried at run time by using a technique called reflection and used in many ways.

What is dynamic type in C#? How it is different from object?

C# 4.0 introduced a new type, dynamic. The type is a static type, but an object of type dynamic bypasses static type checking. In most cases, it functions like type object. At compile time, an element that is typed as dynamic is assumed to support any operation. Therefore, you do not have to be concerned about where the object gets its value from. However, if the code is not valid, errors are caught at run time.

Definition of C# programming language

C# is one of the programming languages designed for the .NET Framework software development by Microsoft. It is most known language for this platform. C# is intended to be a modern, simple, general-purpose, object-oriented programming language. C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.