第7章节工具类和常用算法.pptVIP

  • 6
  • 0
  • 约1.73万字
  • 约 58页
  • 2017-03-31 发布于四川
  • 举报
第7章节工具类和常用算法

import java.util.*; public class ST { public static void main(String[] args) { String str=“中国.四川.攀枝花”; StringTokenizer st=new StringTokenizer(str,“.”); int number=st.countTokens(); System.out.println(“共有单词:”+number); while(st.hasMoreTokens()) { System.out.print(number-st.countTokens()+“:”); System.out.println(st.nextToken()); } } } 共有单词:3 0:中国 1:四川 2:攀枝花 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 字符串数组 字符串数组:可以表示一组字符串 public class StrArray { public static voi

文档评论(0)

1亿VIP精品文档

相关文档