标签:linq 索引 public lin new pre eric 访问 arp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 索引;
namespace 访问修饰符
{
/*
* 修饰类的只有public 和internal(默认,仅限于当前项目的访问)
* 修饰类中成员,可是public private internal protected protected internal
* public:在哪都可以访问
* private:私有的,只能在当前类的内部进行访问
* internal:只能在当前项目中访问。
* protected:受保护的,可以在当前类以及该类的子类中访问
* 在同一个项目中,public的权限跟internal是一样的。
* 子类的访问权限不能高于父类,否则可能破坏父类
* protected internal
*/
class Program
{
static void Main(string[] args)
{
//public class Person,则可以
Person per = new Person();
//internal class Person
//Person per = new Person();
per.Numbers = new int[]{1,2,3};
Console.WriteLine(per[2]);
Console.ReadKey();
}
}
}
标签:linq 索引 public lin new pre eric 访问 arp
原文地址:http://www.cnblogs.com/my-cat/p/7615340.html