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

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


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

2022-05-12 18:20:00
Can you create a function in C# which can accept varying number of arguments?

By using the params keyword, you can specify a method parameter that takes a variable number of arguments. No additional parameters are permitted after the params keyword in a method declaration, and only one params keyword is permitted in a method declaration. The declared type of the params parameter must be a single-dimensional array.
277 views15:20
Открыть/Комментировать
2022-05-07 17:31:00 State the difference between is and as operators in C#

The difference between is and as an operator in C# is that is the operator is used for checking the compatibility of an object for a given type and returning to the Boolean for the results.Whereas as the operator is used for casting of an object to a type or to a class.



501 views14:31
Открыть/Комментировать
2022-05-06 17:35:00
When defining a class using C# Generics, which of the followings is invalid?
Anonymous Quiz
22%
class MyClass where T : struct
6%
class MyClass where T : class
9%
class MyClass where T : IComparable
13%
class MyClass where T : MyBase
49%
All of the above are correct
144 voters479 views14:35
Открыть/Комментировать
2022-05-05 18:20:00 What is the difference between is and as operators in C#?

The is operator checks if an object can be cast to a specific type.

if (someObject is StringBuilder) ...

The as operator attempts to cast an object to a specific type, and returns null if it fails.

StringBuilder b = someObject as StringBuilder;
if (b != null) ...
504 views15:20
Открыть/Комментировать
2022-04-28 17:26:00 What are the fundamental concepts of OOP?

OOP stands for Object-Oriented Programming and the following are the fundamental concepts:

- Encapsulation: It is the internal representation of an object which is hidden from the outside view of an object’s definition. Only required information is accessed while the other data are hidden.

- Abstraction: It is defined as the process of identifying critical behavior, eliminating the irrelevant details and data of an object.

- Inheritance: It is defined as the process of creating new classes from another class. This can be achieved by accessing, modifying, and extending the behavior of the objects in their parent class.

- Polymorphism: It is a term used for describing one name in many forms. It can be achieved through the same name but different implementations.



267 views14:26
Открыть/Комментировать
2022-04-27 17:35:00
What is the result of variable a and b?
Anonymous Quiz
16%
a=true, b=true
40%
a=true, b=false
19%
a=false, b=true
25%
a=false, b=false
97 voters246 views14:35
Открыть/Комментировать
2022-04-27 17:35:00
246 views14:35
Открыть/Комментировать
2022-04-26 18:20:00
What is the difference between dispose and finalize methods in C#?

Finalizer and Dispose both are used for same task like to free unmanaged resources but have some differences see.

Finalize:

Finalize used to free unmanaged resources those are not in use like files, database connections in application domain and more, held by an object before that object is destroyed.

In the Internal process it is called by Garbage Collector and can't called manual by user code or any service.

Finalize belongs to System.Object class.

Implement it when you have unmanaged resources in your code, and make sure that these resources are freed when the Garbage collection happens.

Dispose:

Dispose is also used to free unmanaged resources those are not in use like files, database connections in Application domain at any time.

Dispose explicitly it is called by manual user code.

If we need to dispose method so must implement that class by IDisposable interface.
257 views15:20
Открыть/Комментировать
2022-04-21 17:26:00 ​​ Explain the difference between managed and unmanaged code

MANAGED CODE is a code created by the .NET compiler. It does not depend on the architecture of the target machine because it is executed by the CLR (Common Language Runtime), and not by the operating system itself. CLR and managed code offers developers few benefits, like garbage collection, type checking and exceptions handling.

On the other hand, UMANAGED CODE is directly compiled to native machine code and depends on the architecture of the target machine. It is executed directly by the operating system. In the unmanaged code, the developer has to make sure he is dealing with memory usage and allocation (especially because of memory leaks), type safety and exceptions manually. In .NET, Visual Basic and C# compiler creates managed code. To get unmanaged code, the application has to be written in C or C++.
290 views14:26
Открыть/Комментировать
2022-04-20 17:35:00
Which of the following statements is true about C# anonymous type?
Anonymous Quiz
22%
Anonymous type can add new property once it is created
7%
Anonymous type can add an event
26%
You can use a delegate for a method in anonymous type
45%
Anonymous type is an immutable type
96 voters358 views14:35
Открыть/Комментировать