- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHPPhysics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are dynamic data types in C#?
Store any type of value in the dynamic data type variable. Type checking for these types of variables takes place at run-time.
The following is the syntax for declaring a dynamic type −
dynamic <variable_name> = value;
The following is an example −
dynamic val1 = 100; dynamic val2 = 5; dynamic val3 = 20;
The dynamic types are similar to object types except that type checking for object type variables takes place at compile time, whereas that for the dynamic type variables takes place at run time.
Advertisements