作者TonyQ (骨头)
站内java
标题Re: [问题] 再请教一个关於token的问题
时间Wed May 3 02:16:55 2006
※ 引述《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