标题:新手请教.--cannot find symbol
取消只看楼主
xkrumeng
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-2-4
结帖率:100%
已结贴  问题点数:20 回复次数:1 
新手请教.--cannot find symbol
当我在编译的时候出现的一个问题.
E:\jpp>javac LotteryOdds.java
LotteryOdds.java:10: cannot find symbol
symbol  : method nextIn()
location: class java.util.Scanner
        int n = in.nextIn();
                  ^
1 error

这个应该怎么样解决啊?
我的环境变量设置为:
classPath
.;E:\java\JDK\lib\dt.jar;E:\java\JDK\lib\tools.jar;


程序源码为:

import java.util.*;

public class LotteryOdds
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        System.out.print("How many numbers do yow need to draw?");
        int n = in.nextIn();

        int lotteryOdds = 1;
        for(int i=1;i<=n;i++){
            lotteryOdds = lotteryOdds * (n-i+1)/i;
        }
        System.out.println("Your odds are 1 in "+lotteryOdds+" Good Luck!");
    }
}


[ 本帖最后由 xkrumeng 于 2010-8-17 11:56 编辑 ]
搜索更多相关主题的帖子: symbol cannot find 
2010-08-17 11:53
xkrumeng
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-2-4
得分:0 
谢谢!还真是没注意到.还以为是环境变量错了呢..呵呵
2010-08-17 12:25



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




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

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