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

What is the difference between dynamic type variables and object type variables?

Câu trả lời

Here is the difference between dynamic type variables and object type variables in C#:

Dynamic Type Variables

  • Dynamic types are resolved at runtime, not compile-time. The compiler treats dynamic types as objects and performs late binding.
  • Dynamic types bypass compile-time type checking. The compiler doesn't check the types until runtime.
  • Dynamic types allow you to call any method on them, even if it doesn't exist. Errors are only caught at runtime.
  • Dynamic types are useful for working with dynamic languages like JavaScript or Python from C#.

Object Type Variables

  • Object is the base class of all types in C#. Variables of type obj...
middle

middle

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

expert

You have defined a destructor in a class that you have developed by using the C#, but the destructor
never executed. Why?

expert

Why Abstract class can not be sealed or static?

expert

Can you add extension methods to an existing static class?

Bình luận

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

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