What is difference between late ...
What is difference between late ...
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
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào