
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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.
- Related Articles
- Why JavaScript Data Types are Dynamic?
- How to define dynamic data types in C#
- What are enumerated data types in C++?
- What are pointer data types in C#?
- What are nullable data types in C#?
- What are object data types in C#?
- What are reference data types in C#?
- What are the data types, value types and reference types in C#?
- What are fundamental data types in C++ programming?
- What are user defined data types in C#?
- What are primary data types in C language?
- What are the types of Dynamic Branch Prediction?
- What are dynamic arrays in C#?
- What are string and String data types in C#?
- What are different types of data in C language?

Advertisements