在程序开头有:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;既然已经引用了System命名空间,还要引用它下面的成员Collections.Generic, Linq,Text呢?
不是会默认包括进去的吗?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;既然已经引用了System命名空间,还要引用它下面的成员Collections.Generic, Linq,Text呢?
不是会默认包括进去的吗?
using System;
不是一定要引入命名空间。例如在System里的Console下有函数WriteLine:
在不加命名空间时必须输入:System.Console.WriteLine("xxx");如果加了的话直接 Console.WriteLine("xxx")。这样就少写了 System.xxx,如果用的地方多了最好加上,一个半个的话就手动全写吧。
下面的都是一个道理