Re: [問題] 再請教一個關於token的問題
※ 引述《ogamenewbie (荷蘭爛銀行)》之銘言:
: 你先這樣印印看, 看看程式跟你的想法有沒有差距...
: ※ 引述《winsonblue (一起共同創造回憶)》之銘言:
: : 我現在的作法是
: : 有很多不同的字串 例如String a[10]
: : 然後我依照每個字串開頭的token做不同的動作
: : for(k=0;a[k]!="\0";k++){
: : StringTokenizer tokens = new StringTokenizer(a[k]);
: : while(tokens.hasMoreTokens()) {
: String temp = tokens.nextToken();
: if((temp).equals("SELECT"))
: : Select();
//System.out.println("tokens: " + temp);
//temp = tokens.nextToken();
: if((temp).equals("INSERT"))
: : Insert();
//System.out.println("tokens: " + temp);
//temp = tokens.nextToken();
: if((temp).equals("DELETE"))
: : Delete();
: System.out.println("tokens: " + temp);
: : }
: : }
: : 以上大致是我的想法
: : 但是我這樣跑的話 會提醒我有java.util.NoSuchElementException
: : 不知道是錯在什麼地方呢? 請大家指點迷津一下 謝謝!
--
LOCAL,我覺得這才是它想要的.
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the complier will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.pratice()); | Bone everything
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.138.240.58
討論串 (同標題文章)