java第5次作业

题目一:

public class HomeworkDemo01 {

public static void main(String[] args) {
String str = "耿丹学院物联网Java2017320";
System.out.println(str.substring(11));
}

}

题目二:

public class HomeworkDemo02 {

public static void main(String[] args) {
String str = "耿丹计算机Java20170320";
String newStr = str.replaceAll("Java", "J2EE");
System.out.println("替换后的结果:"+newStr);
}

}

题目三:

public class HomeworkDemo03 {

public static void main(String[] args) {
String str1="耿丹 计算机 Java 2017320";
String newStr = str1.replaceAll(" ", "");
System.out.println("替换后的结果:"+newStr);
}

}

题目四:

public class HomeworkDemo04 {

public static void main(String[] args) {
String str = "11011119980201xxxx";
System.out.println(str.substring(10,14));

}

}

posted on 2017-03-28 23:33  BGD160809315  阅读(155)  评论(2编辑  收藏  举报

导航