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

What is difference between late ...

Câu trả lời

The main difference between early binding and late binding in C# is when the target method is resolved:

  • Early binding (also known as static binding) resolves the target method at compile-time. The compiler inserts code to directly call the method. If the method doesn't exist, a compile-time error occurs[1][3].

  • Late binding (also known as dynamic binding) resolves the target method at runtime using reflection. The method name is looked up at runtime. If the method doesn't exist, a runtime error occurs[1][3].

Some key differences:

  • Early binding is faster since no runtime lookup is needed[4][5]. Late binding has some performance overhead.

  • Early binding requires the method to be known at compile-time. Late binding allows calling methods whose existence is only known at runtime[1][3].

  • Overloaded methods use early binding, while ...

senior

senior

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

middle

Is there a way to catch multiple exceptions at once and without code duplication?

junior

What is Serialization?

middle

What is the difference between Equality Operator ( == ) and Equals() Method in C#?

Bình luận

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

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