Learn C# programming language with this comprehensive C# tutorial series. From beginner to advanced topics, It covers everything you need to know to become proficient in C# programming.
As you know, a value type variable cannot be assigned a null value. For example, if you try to assign a null value to the value type int i = null it will give you a compile-time error. In this post, you will learn about the C# Nullable Types with the help of multiple examples.
Node.js is an open-source, cross-platform runtime environment and library for executing JavaScript code outside of a browser. It uses an event-driven, asynchronous, non-blocking I/O architecture, making it lightweight and efficient for data-intensive real-time applications running across distributed devices.
Node.js is neither a framework nor a programming language but a runtime environment. It was written and introduced by Ryan Dahl in 2009. Node.js was built on top of chrome V8 JavaScript Engine that is written in C++ language. All the JavaScript code is executed by the V8 JavaScript engine; which converts the code into Assembly code, which is then converted into machine code. Machine code is something that a computer processor understands.
The dynamic keyword is used to define dynamic types. Dynamic type is used to avoid compile-time type checking. The compiler does not type-check dynamic type variables at compile time, instead, the compiler check the type at the run time. If the syntax of the statement is invalid, an error will be thrown at runtime.
Dynamic types are similar to object types, despite the fact that type checking for object type variables occurs at compile time rather than at runtime for dynamic type variables.
In general, the code written in C# is safe code that doesn`t directly access memory using pointers. It also doesn’t allocate raw memory. Instead, managed objects are created. On the other hand, unsafe code in C# usually refers to a section of code that is not processed by the CLR (Common Language Runtime) and directly access memory using pointers.
Since pointers are complex and might result in memory-related errors like stack overflow, overwritten system memory, etc., extra caution must be taken while handling unsafe code. By default, pointers are not supported in C#. However, the use of pointer variables is permitted by the unsafe keyword.
C# Events: The Events enable a class or object to notify other classes or objects when some interesting thing happens to the object. A class that sends or raises the event is called the publisher, and the classes that receive or handle the event are referred to as subscribers.
There can be multiple subscribers to a single event. Typically, when an action takes place, a publisher raises an event. The subscribers who want to be notified when an action takes place should register or subscribe to handle specific events.
Boxing is the process of converting a value type into a reference type, and unboxing is the process of converting a reference type back into a value type.
“In C#, a hashtable is a non-generic collection that can store key/value pairs of any data type. On the other hand, A dictionary is a generic collection that can store key/value pairs of specific data types.”
In this article, we will learn the differences between the Hashtable and Dictionary with examples.
C# Arrays: An Array is used to store multiple values in a single variable, rather than declaring a separate variable for each element. It is a fixed-sized sequential collection of elements of the same type. The data types of the elements in an array can be int, char, float, string, and so on, and they are stored in a contiguous location.
Comments are used in a program to make a section of code easier to understand. They’re used to make the code more readable and provide a formal description of it and how it works.
The compiler ignores comments, so you may put them wherever in a program and not worry about them breaking it.
Generics in C# allow you to write type-safe, reusable, and efficient code. In this comprehensive guide, you will learn everything you need to know about generics including how to create generic classes, methods, collections, and generic constraints. This article contains valuable information about C# generics that will help both beginners and experienced C# developers enhance their coding abilities.
C# Generics allow you to reuse the same code (class or method) with different data types. It refers to a generalized version of something rather than a specialized version.
In this post, we’ll look at a simple but difficult interview question in C#: Call By Value vs Call By Reference.
This is a question that both fresher and experienced developers are asked in interviews. It’s one of the most frequently asked questions by technical interviewers.
Difference between Call by Value and Call by Reference
In C#, the key difference between abstraction and encapsulation is that encapsulation wraps data and methods into a single unit called class, whereas abstraction hides implementation details and just shows users the functionality.
In ASP.NET Core, middleware is a component that can be plugged into the request processing pipeline to perform some action for each request. It sits between the server and the application and is responsible for handling requests and responses.
This post includes the top 50 C# interview questions and answers for freshers and experienced professionals. This article will assist you in improving your C# knowledge and evaluating your present C# understanding.
A collection in C# is a class that represents a group of objects. Collections can be used to perform various operations on objects, such as storing, updating, deleting, retrieving, searching, and sorting.
Collections are defined in the System.Collections namespace. They are a predefined set of classes for storing multiple items in a single unit.
WCF (Windows Communication Foundation) is a framework for building service-oriented applications. It allows communication between applications on different devices, across computers and networks. WCF is part of the .NET framework, and it provides a runtime environment for applications that use distributed communication.
Web API is a framework for building HTTP services. It is a part of the ASP.NET platform and it allows you to create RESTful (representational state transfer) services, which can be consumed by a wide range of clients including web browsers and mobile devices.
This article will provide a practical comparison of WCF and Web API to help you decide which is the better option for your needs. We will discuss the differences between these two frameworks in detail.
As a programming language, C# has gone through several iterations, and with each new version, we see new features and enhancements that make programming with it even better. C# 10, the latest language version, is no exception.
In this article, we will explore the new features of C# 10 and provide examples of how to use them in your code.