Akshay Khot has Published 41 Articles

Explain the iterator pattern in .NET

Akshay Khot

Akshay Khot

Updated on 19-May-2021 12:50:41

241 Views

The iterator pattern is used to loop over the elements in a collection and is implemented using the IEnumerator interface. It defines the basic low-level protocol through which elements in a collection are traversed—or enumerated. This is done in a forward-only manner.Here's the IEnumerator interface in C#.public interface IEnumerator{   ... Read More

How to work with XML and JSON in .NET?

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:19:11

804 Views

Working with JSONJSON is a data format that has become a popular alternative to XML. It is simple and uncluttered with a syntax similar to a JavaScript object. In fact, the term JSON stands for JavaScript Object Notation. The recent versions of .NET provide built-in support for working with JSON ... Read More

Explain dependency injection in C#

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:18:30

15K+ Views

A dependency is an object that another object depends on. Dependency Injection (or inversion) is basically providing the objects that an object needs, instead of having it construct the objects themselves. It is a useful technique that makes testing easier, as it allows you to mock the dependencies.For example, if ... Read More

System.Reflection namespace in C#

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:17:54

406 Views

System.Reflection namespace in C# The System.Reflection namespace in C# contains the types that provide information about assemblies, modules, members, parameters, and other items in the code by examining the metadata. The Assembly class in this namespace represents an assembly. Typically, you can access it using the Assembly property on a ... Read More

Explain how the assemblies and DLLs work in .NET

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:17:06

471 Views

Assembly contains all the compiled types in your application along with their Intermediate Language (IL) code. It is also the basic unit of deployment in .NET. In the latest versions of .NET, i.e. .NET Core, an assembly is a file with a .dll extension, which stands for Dynamic Link Library.There ... Read More

Explain the stream architecture in .NET

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:16:29

326 Views

The .NET streams architecture provides a consistent programming interface for reading and writing across different I/O types. It includes classes for manipulating files and directories on disk, as well as specialized streams for compression, named pipes, and memory-mapped files.The streaming architecture in .NET relies on a backing store and adapters.Backing ... Read More

Explain the custom value types in .NET

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:15:02

861 Views

Variables of value types directly contain the values. When you assign one value type variable to another, each variable associates with a different storage location in memory. Hence, Changing the value of one value type variable doesn't affect the value in the second variable.Similarly, when you pass an instance of ... Read More

What is the purpose of the StringBuilder class in C#?

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:11:13

331 Views

In C#, strings are immutable. That means you cannot modify a string once it's created. Any modification to the string returns a new string that contains the modification, leaving the original string intact.string word = "aaabbbccc"; string newWord = word.Replace('b', 'd'); Console.WriteLine(word); // prints aaabbbccc Console.WriteLine(newWord); // prints aaadddcccStringBuilder class ... Read More

Explain how reflection works in .NET framework

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:10:23

256 Views

A C# program compiles to a DLL assembly that contains the compiled C# code along with the metadata for the runtime, and other resources. C# provides a reflection API that lets us inspect the metadata and compiled code at runtime.Using reflection, it's possible to −Access the assembly metadata for all ... Read More

What are some of the important namespaces in C#? Provide a brief description of each

Akshay Khot

Akshay Khot

Updated on 19-May-2021 08:07:39

284 Views

.NET contains a lot of namespaces and many more, if you include the third-party libraries. However, there are a few that you will use over and over. Here are the twenty that will get you through 80% of the common, recurring programming problems.SystemContains the most fundamental types. These include commonly ... Read More

Advertisements