1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace Demo2 8 { 9 class Program 10 { 11 static void Main(string[] args) 12 { 13 int age = 30; 14 int age2; 15 age2 = age; 16 age2 = 35; 17 Console.WriteLine("age:"+age); 18 Console.WriteLine("age2:"+age2); 19 Console.Read(); 20 } 21 } 22 }
运行结果:
如果未指定f'或者d,默认为f类型;如果初始值为赋值,默认值为0,不是0.0;
object不区分大小写