Re: [問題] 再請教一個關於token的問題

看板java作者 (骨頭)時間18年前 (2006/05/03 02:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/12 (看更多)
※ 引述《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
文章代碼(AID): #14Lw7SU1 (java)
討論串 (同標題文章)
本文引述了以下文章的的內容:
以下文章回應了本文
完整討論串 (本文為第 5 之 12 篇):
文章代碼(AID): #14Lw7SU1 (java)