系统debug时出现错误,System.AccessViolationException: 尝试读取或写入受保护的内存.这通常指示其他内存已损坏. Attempted to read or write protected memory. This is often an indication that other memory is corrupt 从网上查阅,大多都是说因为调用C++等dll等等,但系统中确实没有关于其他dll的调用,很是郁闷.最后查得设置配置参数即可. 解决办法: Tools…
ruby中的私有方法是指方法只能被隐含调用,不能被显示调用.而当没有显示接收者的时候,会把self当成接收者.因此,只能在自身中调用私有方法,这也是私有方法的调用规则. ruby的私有方法机制目的是:使得你很容易将方法分为两种,外部世界可以访问的方法和外部世界不可以访问的方法. 如下: class A def a self.method end def method p "hello world" end private :method end A.new.a method定义成私有方…