云大java实验Lab4
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
云南大学软件学院
实验报告
姓名:学号:班级:日期:成绩:
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 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.java 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 = "China"
三、实验内容:
1.
2.
3.
三、实验总结:
了解熟悉了类String,StringBuffer和StringTokenizer的含义和构造方法。
指导教师签名: