method:countTokens ();return type:intcontent:ใช้นับจำนวน token ทั้งหมดexample:StringTokenizer str_token = new StringTokenizer ( "bam, boo, lab, code", ", " ); int count = str_token.countTokens();