《云南大学软件学院JAVA实验四》由会员分享,可在线阅读,更多相关《云南大学软件学院JAVA实验四(4页珍藏版)》请在人人文库网上搜索。
1、云南大学软件学院实 验 报 告姓名: 王增伟 学号: 班级: 软件工程 日期: 2014.10.15 成绩: JAVA实验四一、 实验目的:Fundamental Programming Structures in Java: Strings二、 实验要求:1 Write a program called String1.java and do the following: Create a String object that accepts input from the user. Referencing the JDK docs, execute 2 different methods 。
2、on the String. Print the results of the methods.2 Write a program called StringBuffer1.java that does the following: Create a StringBuffer object. Referencing the JDK docs, execute 2 different methods on the StringBuffer. Print the results of the methods.3 Write a program called StringTokenizer1.jav。
3、a that accepts a string, looks for commas within the string, and breaks the string up into the parts separated by the comma. For example, the string Kunming, Yunnan, China would return three strings: String1 = Kunming String2 = Yunnan String3 = China3、 实验内容:1. String1.java代码如下:结果显示:2. StringBuffer1.java代码如下:结果显示为:3. StringTokenizer1.java结果显示为:4、 实验总结:本次实验通过运用字符串的部分函数,进一步的熟练了对字符串的使用。字符串的使用中要区分中文和英文标点。指导教师签名:。