摘要:
总结:package com.a.b;//startWith().和endWith()是检查一个字符串是否以一个特定的字符序列开始或结束public class Sdfs { public static void main(String[] args) { String t1 = "I like java"; String startStr = "I"; String endStr = "java";// 这里java是区分大小写的。所以字母全部一模一样 if (t1.startsWith(startStr)) System.out. 阅读全文
posted @ 2013-12-24 22:22
juewang
阅读(957)
评论(0)
推荐(0)
摘要:
总结:indexOf(String str,int index)方法.从参数指定位置开始,如果index值超过了字符串长度,则返回-1package com.a.b;import java.io.*;public class Chen { public static void main(String[] args) throws IOException { //线程。继承。抽象 String test="After learning the material"; String theStr="arn"; int index=0,theCount=0; i 阅读全文
posted @ 2013-12-24 22:00
juewang
阅读(552)
评论(0)
推荐(0)
摘要:
总结: 主要是 捕获异常package com.a.b;import java.io.*;public class testData { public static void main(String[] args) throws IOException { File newDir = new File("c:\\javas"); if (!newDir.exists()) { newDir.mkdir();// 如果目录不存在,就创建目录 File newFile = new File(newDir, "test.txt"); try { newFile 阅读全文
posted @ 2013-12-24 07:45
juewang
阅读(301)
评论(0)
推荐(0)
摘要:
总结:没体会到package com.a.b;import java.io.*;public class tsetOut { public static void main(String[] args) throws IOException { char ch; int i; File newDir=new File("C:\\JavaTest2"); if(!newDir.exists()){ newDir.mkdir(); File newFile=new File(newDir,"newTest.txt"); FileOutputStream ou 阅读全文
posted @ 2013-12-24 00:04
juewang
阅读(479)
评论(0)
推荐(0)
浙公网安备 33010602011771号