Topic: 死活看不出错在哪里?(';' expected -- 已解答)

  Print this page

1.死活看不出错在哪里?(';' expected -- 已解答) Copy to clipboard
Posted by: ff_ff
Posted on: 2006-03-12 19:16

public class Add
{
   public static void main(String args[])
   {
     int sum=0;
     for(int i=1;i<=100;i++)
        {
            sum = sum + i;
        }
     System.out.println(sum);
     int sum1=0;
     int i=1;
     While (i<=100)
     {
            sum1 = sum1 + i;
            i=i+1;
     }
     System.out.println(sum1);
    
   }
}
让大家见笑了.帮看看

';' expected
{

2.Re:死活看不出错在哪里? [Re: ff_ff] Copy to clipboard
Posted by: Skybus
Posted on: 2006-03-12 19:34

what is your problem?
while or While?

3.Re:死活看不出错在哪里?(';' expected) [Re: ff_ff] Copy to clipboard
Posted by: why
Posted on: 2006-03-12 20:32

While

4.Re:死活看不出错在哪里? [Re: ff_ff] Copy to clipboard
Posted by: zym
Posted on: 2006-03-12 21:31

呵呵``看来楼主还是没有认真检查!

5.Re:死活看不出错在哪里?(';' expected) [Re: why] Copy to clipboard
Posted by: YuLimin
Posted on: 2006-03-13 09:08

估计是受MS的VB之类的影响吧

是while,w是小写,不是大写:)

6.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: laies
Posted on: 2006-03-14 12:28

定义数组可以用空格名字代替吗?

7.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: laocm_007
Posted on: 2006-03-14 22:00

把 public class Add中的public 去掉吧

8.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: laies
Posted on: 2006-03-14 23:18

楼上你看错了,在创建俩个public类会出现名字的纠纷。

is" while ",not"While".

9.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: ff_ff
Posted on: 2006-03-18 09:35

谢谢各位,汗.

请问版主:
贵论坛是积分制?如何结帖给分?

10.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: caoguanghui
Posted on: 2006-03-18 21:19

why 真是细心啊!

11.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: 学长
Posted on: 2006-03-18 22:28

呵呵,学习ing,顶

12.Re:死活看不出错在哪里?(';' expected -- 已解答) [Re: ff_ff] Copy to clipboard
Posted by: lgh3292
Posted on: 2006-03-19 20:52

呵,我刚才也想回答是大小写错了,不过早有人知道了,不过知道了这个问题所在的答案.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923