标题:该类的成员有该类的对象,怎么理解,怎么有死循环的感觉,可上机调试有没问题 ...
只看楼主
秉烛夜游
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2017-11-21
 问题点数:0 回复次数:1 
该类的成员有该类的对象,怎么理解,怎么有死循环的感觉,可上机调试有没问题.拜托!
imports system
namespace vbnetbook.chapter01
  public class stack
      dim top as entry
      public sub push(byval data as object)
         top=new entry(top,data)
      end sub
  public function pop() as object
      if(top is nothing) then
         throw new invalidoperationexception()
      end if
      dim result as object=top.data
      top=top.nextdata
      return result
   end function
   class entry
      public nextdata as stack.entry
      public data as object
            Sub New(ByVal nextdata As stack.entry, ByVal data As Object)
                Me.nextdata = nextdata
                Me.data = data
            End Sub
    end class
  end class
end namespace
搜索更多相关主题的帖子: public top data object end 
2017-11-21 15:33
zhangcanwei
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:63
专家分:135
注 册:2010-7-4
得分:0 
没有用过嵌套类。我感觉是嵌套引起的
2017-11-22 07:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-482699-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.502655 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved