Получи случайную криптовалюту за регистрацию!

C# 1001 notes

Логотип телеграм канала @csharp_1001_notes — C# 1001 notes C
Логотип телеграм канала @csharp_1001_notes — C# 1001 notes
Адрес канала: @csharp_1001_notes
Категории: Технологии
Язык: Русский
Количество подписчиков: 2.63K
Описание канала:

Регулярные короткие заметки по C# и .NET.
Просто о сложном для каждого.
admin - @notxxx1

Рейтинги и Отзывы

3.50

2 отзыва

Оценить канал csharp_1001_notes и оставить отзыв — могут только зарегестрированные пользователи. Все отзывы проходят модерацию.

5 звезд

1

4 звезд

0

3 звезд

0

2 звезд

1

1 звезд

0


Последние сообщения 4

2022-04-20 17:35:00
The followings are some examples of integer arrays. Which expression is not valid in C#?
Anonymous Quiz
5%
int[] a = new int[10];
7%
int[][] c = new int[10][];
44%
int[][][] cc = new int[10][2][];
3%
int[,] b = new int[10, 2];
40%
int[, , ,] d = new int[10, 2, 2, 2];
129 voters351 views14:35
Открыть/Комментировать
2022-04-19 17:15:00
What is the Constructor Chaining in C#?

Constructor Chaining is an approach where a constructor calls another constructor in the same or base class. This is very handy when we have a class that defines multiple constructors.
396 views14:15
Открыть/Комментировать
2022-04-14 17:26:00 ​​ Discuss the difference between constants and read-only variables

While constants and read-only variable share many similarities, there are some important differences:

- Constants are evaluated at the compile-time, while the read-only variables are evaluated at the runtime.

- Constants support only value-type variables, while read-only variables can hold reference type variables.

- Constants should be used when the value is not changing during the runtime, and read-only variables are used mostly when their actual value is unknown before the runtime.
648 views14:26
Открыть/Комментировать
2022-04-13 17:35:00
Class A has [Serializable()] attribute. When is [Serializable] checked?
Anonymous Quiz
29%
At C# compile time
42%
At CLR runtime
17%
At JIT compile time
12%
At Linking
174 voters603 views14:35
Открыть/Комментировать
2022-04-13 17:35:00
539 views14:35
Открыть/Комментировать
2022-04-12 18:20:00
Why to use lock statement in C#?

The lock keyword ensures that one thread does not enter a critical section of code while another thread is in the critical section. If another thread tries to enter a locked code, it will wait, block, until the object is released.

The lock keyword calls Enter at the start of the block and Exit at the end of the block. lock keyword actually handles Monitor class at back end.
605 views15:20
Открыть/Комментировать
2022-04-07 17:26:00 ​​ Explain what LINQ is

LINQ is an acronym for Language Integrated Query, and was introduced with Visual Studio 2008. LINQ is a set of features that extends query capabilities to the .NET language syntax by adding sets of new standard query operators that allow data manipulation, regardless of the data source. Supported data sources are: .NET Framework collections, SQL Server databases, ADO.NET Datasets, XML documents, and any collection of objects that support IEnumerable or the generic IEnumerable interface, in both C# and Visual Basic. In short, LINQ bridges the gap between the world of objects and the world of data.
822 views14:26
Открыть/Комментировать
2022-04-06 17:35:00
In multithread programming, which of the followings is not using Thread Pool?
Anonymous Quiz
17%
BackgroundWorker class
26%
Asynchronous delegate
37%
Thread class
20%
Task class
178 voters753 views14:35
Открыть/Комментировать
2022-04-05 18:20:00
Is operator overloading supported in C#?

A user-defined type can overload a predefined C# operator. That is, a type can provide the custom implementation of an operation in case one or both of the operands are of that type.

The above function implements the addition operator (+) for a user-defined class Box. It adds the attributes of two Box objects and returns the resultant Box object.
703 views15:20
Открыть/Комментировать
2022-03-31 17:19:00 ​​ Discuss what garbage collection is and how it works. Provide a code example of how you can enforce garbage collection in .NET

Garbage collection is a low-priority process that serves as an automatic memory manager which manages the allocation and release of memory for the applications. Each time a new object is created, the common language runtime allocates memory for that object from the managed Heap. As long as free memory space is available in the managed Heap,the runtime continues to allocate space for new objects. However, memory is not infinite, and once an application fills the Heap memory space, garbage collection comes into play to free some memory.

When the garbage collector performs a collection, it checks for objects in the managed Heap that are no longer being used by the application and performs the necessary operations to reclaim the memory. Garbage collection will stop all running threads, it will find all objects in the Heap that are not being accessed by the main program and delete them. It will then reorganize all the objects left in the Heap to make space and adjust all the Pointers to these objects in both the Stack and the Heap.

To enforce garbage collection in your code manually, you can run the following command (C#):

System.GC.Collect();
875 views14:19
Открыть/Комментировать