Topic: [servlet]switch

  Print this page

1.[servlet]switch Copy to clipboard
Posted by: 宮本保藏
Posted on: 2003-10-18 07:41

switch(value)
    {
      for(i=1;i<=10;i++)
      {
      case i: out.println(i):break;
      }
    default: out.println("輸入錯誤ㄛ"):;
    }

怎麼會錯誤呢

2.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: rainman
Posted on: 2003-10-18 09:09

可以这样用啊

3.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: 宮本保藏
Posted on: 2003-10-18 15:36

編譯的時候會錯誤

4.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: 宮本保藏
Posted on: 2003-10-18 17:20

我找到另一方式解決了^^

5.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: amoni
Posted on: 2003-10-18 22:16

不可这样用吧??

6.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: mannajava
Posted on: 2003-10-21 08:03

大范围的判断用if-else不是更好吗?

7.Re:[servlet]switch [Re: 宮本保藏] Copy to clipboard
Posted by: mannajava
Posted on: 2003-10-21 08:08

case 后面要跟常数


   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