[問題] about StringTokenizer

看板java作者 (我不是壞人好嗎??)時間19年前 (2006/10/17 20:23), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/6 (看更多)
import java.util.*; import java.io.*; class test { BufferedReader br=nuew BufferedReader(new InputStreamReader(system.in)); str=br.readLine(); StringTokenizer tokens = new StringTokenizer(str); String temp; while(tokens.hasMoreTokens()){ temp=tokens.nextToken(): if(temp=="ins") System.out.println("Find ins in the input"); else System.out.print("notFound"); } } 我想要從輸入的資料中找找看有沒有 ins這個token 但是雖然有輸入ins這樣的token 程式 跑出來的結果 卻還是notFound 已經卡了三天了 希望哪為大大可以幫我解惑 感恩 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 202.178.206.204
文章代碼(AID): #15DCiv3o (java)
討論串 (同標題文章)
文章代碼(AID): #15DCiv3o (java)