static方法不需要对象便可以引用,也就是说和类相关和对象实例不相关。

解决方案 »

  1.   

    不用PUBLIC而用PRIVATE也可以在外面通過 类名.静态方法名 來引用嗎?
      

  2.   

    static是静态的意思,public或private与其他成员一样
    1、访问static成员,只能用类而不是实例化的对象;
    2、static方法只能访问static属性;
    3、static成员可以保留其值。
      

  3.   

    Private: Accessible only by methods in the defining type.
    Public: Accessible to all methods in all assemblies.
    Static: Method is associated with the type itself,not an instance of the type.Static methods can't access instance fields or methods defined within the type because the static method isn't aware of any object.
      

  4.   

    static 静态的,不用new 实例化就能调用
      

  5.   

    ddy2000(梦归自然)说得已经很清楚了.
      

  6.   

    楼上几位DD:form1内定义:
    private sataic string aa;form2内访问:
    form1.aa="abc";  //这句能不能访问到变量?
      

  7.   

    to sky888888(人月神话) 不能
      

  8.   

    理解对象化编程,不要拘泥于范围编程在对象化编程里,所有的事件方法都是由对象派生而static 是特别的派生,它可以在类的静态对象里不必将它应用到实例就可以访问到
    而范围控制是指它的作用范围,比如public 表示它在全局范围有效,和是否被实例化无关
      

  9.   

    如果不理解就简单理解为:static 表示着可以被访问到的范围
    而public 表示着该变量或对象的有效范围,如果出了有效范围,能访问到也无效
      

  10.   

    static成员可以被所有类对象所公有
      

  11.   

    static是指在调用一个方法之前不必先建立对象的实例。
    进行累加的时候有用。