| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 593 人关注过本帖
标题: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
快速回复:cannot found symbol错误
数据加载中...
 
   



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

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