Difference between Var and Dynamic in c# #csharp #csharpinterviewquestions #interview
#Var #Dynamic #difference #csharp #interview
In C#, var and dynamic are both used to declare variables, but they have different meanings.
Var:
Var is used to declare implicitly typed variables. It allows the compiler to infer the type of the variable based on the expression on the right-hand side of the assignment operator. Once the type is inferred, it cannot be changed.
Dynamic:
Dynamic, on the other hand, is used to declare a variable whose type is determined at runtime. This means that the type of the variable can change based on the value assigned to it.
In summary, var is used for static typing while dynamic is used for dynamic typing. var is determined at compile-time while dynamic is determined at runtime.
Видео Difference between Var and Dynamic in c# #csharp #csharpinterviewquestions #interview канала Interview Preparation
In C#, var and dynamic are both used to declare variables, but they have different meanings.
Var:
Var is used to declare implicitly typed variables. It allows the compiler to infer the type of the variable based on the expression on the right-hand side of the assignment operator. Once the type is inferred, it cannot be changed.
Dynamic:
Dynamic, on the other hand, is used to declare a variable whose type is determined at runtime. This means that the type of the variable can change based on the value assigned to it.
In summary, var is used for static typing while dynamic is used for dynamic typing. var is determined at compile-time while dynamic is determined at runtime.
Видео Difference between Var and Dynamic in c# #csharp #csharpinterviewquestions #interview канала Interview Preparation
difference between var and dynamic in c# difference between var and dynamic difference between var and dynamic in c# with example difference between var dynamic and object in c# with example difference between dynamic and generic in c# difference between var and object in c# var vs dynamic difference between var and dynamic keyword in c# difference between dynamic and var in c# difference between var and dynamic keywords in c# differences between var and dynamic in c#
Комментарии отсутствуют
Информация о видео
6 мая 2023 г. 0:05:52
00:00:58
Другие видео канала