Câu hỏi phỏng vấn C#
Câu hỏi

What is an anonymous function in C#?

Câu trả lời

An anonymous function in C# is a function that has no name and is defined without a formal method declaration. It is typically used when you need a simple function for a short period of time, such as when passing a function as an argument to another method or when using LINQ (Language Integrated Query) to query and manipulate data.

There are two main types of anonymous functions in C#:

Lambda Expressions

Lambda expressions are the most common form of anonymous functions in C#. They use the lambda operator (=>) to separate the function parameters from the function body. The syntax for a lambda expression is:

(parameters) => expression

or

(parameters) => { statements; }

Here's an example of a lambda exp...

middle

middle

Gợi ý câu hỏi phỏng vấn

junior

What is an Abstract Class?

junior

Can multiple catch blocks be executed?

entry

What are Property Accessors?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào