标题:cannot found symbol错误
取消只看楼主
しΟν∈→鱈
Rank: 1
等 级:新手上路
威 望:2
帖 子:369
专家分:0
注 册:2006-10-25
 问题点数:0 回复次数:3 
cannot found symbol错误

程序如下:
import java.util.*;

class rr
{
LinkedList threadList = new LinkedList();
public int n=0;
public rr(int i,LinkedList thrList)
{
n=i;
threadList=thrList;
if(i!=0)
System.out.println(threadList.getFirst().n);
}

}

public class Fr {
public static void main(String s[]) {

LinkedList threadList=new LinkedList();
for(int i=0;i<2;i++)
{
rr obr=new rr(i,threadList);
threadList.add(obr);
}

}
}

搜索更多相关主题的帖子: symbol cannot found LinkedList public 
2007-01-10 17:23
しΟν∈→鱈
Rank: 1
等 级:新手上路
威 望:2
帖 子:369
专家分:0
注 册:2006-10-25
得分:0 

  是我发错程序了:下面我做过强制转换了啊,还是错
import java.util.*;

class rr
{
LinkedList threadList = new LinkedList();
public int n=0;
public rr(int i,LinkedList thrList)
{
n=i;
threadList=thrList;
if(i!=0)
System.out.println((rr)threadList.getFirst().n);
}

}

public class Fr {
public static void main(String s[]) {

LinkedList threadList=new LinkedList();
for(int i=0;i<2;i++)
{
rr obr=new rr(i,threadList);
threadList.add(obr);
}

}
}


开开心心的过&玩每一天!!!!
2007-01-10 17:32
しΟν∈→鱈
Rank: 1
等 级:新手上路
威 望:2
帖 子:369
专家分:0
注 册:2006-10-25
得分:0 
改成这样System.out.println(((rr)threadList.getFirst()).n);多加一个括号!!
但是我不知道为什么,冰封老大能讲下么?   晕死 搞了半个小时还是这个问题,开始我就是没加括号 所以不知道错在哪?  

开开心心的过&玩每一天!!!!
2007-01-10 17:38
しΟν∈→鱈
Rank: 1
等 级:新手上路
威 望:2
帖 子:369
专家分:0
注 册:2006-10-25
得分:0 

开开心心的过&玩每一天!!!!
2007-01-10 17:43



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




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

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