90
1
using System;
2
using System.Threading;
3
4
public class Program
5
{
6
static readonly string readonlystring; //you can levae it blank and can assign value at runtime,assign object to it
7
const string constring ="abc"; // you have to assign some value to const while declaring,you can assign ref type to const
8
9
static Program()
10
{
11
readonlystring ="aaaa";
12
}
13
public static void Main()
14
{
15
16
//1. Var vs Dynamic
17
var a = "aaaaa";
18
19
//a = 1; // Cannot implicitly convert type 'int' to 'string'
20
21
dynamic ab = "aaaaa";
22
ab =1;
23
Console.WriteLine(a.GetType());
24
Console.WriteLine(ab.GetType());
Cached Result
3.6966666666666666666666666667