- Java code
package com.longlizhi;public class Test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub }}class Child{ int no; Child nextChile; public Child(int no) { this.no=no; } }class CycLink{ Child firstChild=null; Child temp; int len=0; public void setLen(int len) { this.len=len; } public void createLink() { for(int i=1;i<=len;i++) { if(i==1) { Child ch=new Child(i); this.firstChild=ch; this.temp=ch; } else { if(i==len) { Child ch=new Child(i); temp.nextChile=ch; temp=ch; temp.nextChile=this.firstChild; } else { Child ch=new Child(i); temp.nextChile=ch; temp=ch; } } } } }
请问 temp.nextChile=this.firstChild 中temp.nextChile 是什么意思?
------解决方案--------------------------------------------------------
这个是链表,temp.nextChile是指向下一个节点