摘要: 字符串格式化 import java.util.*; public class StringFormat {// 字符串格式化 public static void main(String[] args) { double e = Math.E; System.out.format("%f%n", 阅读全文
posted @ 2021-10-09 22:45 慢漫曼蔓 阅读(19) 评论(0) 推荐(0)
摘要: 字符串性能比较测试 public class StringComparePerformance {//字符串性能比较测试 public static void main(String[] args) { long startTime = System.currentTimeMillis(); for 阅读全文
posted @ 2021-10-08 13:33 慢漫曼蔓 阅读(39) 评论(0) 推荐(0)
摘要: 查找字符串最后一次出现的位置 public class SearchlastString {//查找字符串最后一次出现的位置 public static void main(String[] args) { String strOrig = "Hello world ,Hello Runoob"; 阅读全文
posted @ 2021-10-07 19:30 慢漫曼蔓 阅读(285) 评论(0) 推荐(0)
摘要: 删除字符串中的一个字符 public class Main {//删除字符串中的一个字符 public static void main(String[] args) { String str = "this is Java"; System.out.println(removeCharAt(str 阅读全文
posted @ 2021-10-06 17:21 慢漫曼蔓 阅读(348) 评论(0) 推荐(0)
摘要: 字符串替换 public class StringReplaceEmp {//字符串替换 public static void main(String[] args) { String str = "Hello World"; System.out.println( str.replace('H', 阅读全文
posted @ 2021-10-05 21:30 慢漫曼蔓 阅读(26) 评论(0) 推荐(0)
摘要: 字符串比较 public class StringCompareEmp {//字符串比较 public static void main(String[] args) { String str = "Hello World"; String anotherString = "hello world" 阅读全文
posted @ 2021-10-04 13:29 慢漫曼蔓 阅读(20) 评论(0) 推荐(0)
摘要: import java.util.Random;import java.lang.Math;import java.util.Scanner; public class RandomCommon { public static char operator(int se) { char op=' '; 阅读全文
posted @ 2021-10-03 22:07 慢漫曼蔓 阅读(44) 评论(0) 推荐(0)
摘要: import java.util.Random;import java.lang.Math;import java.util.Scanner; public class RandomCommon { public static char operator(int n,int se) { char o 阅读全文
posted @ 2021-10-01 21:16 慢漫曼蔓 阅读(33) 评论(0) 推荐(0)
摘要: 请看以下代码,你发现了有什么特殊之处吗? 有两个以square的方法,用了方法重载,但形参的个数,种类,排列顺序一定要是不同的。 2.练习:查看一下JDK中System.out.println()方法,你发现了什么? JDK中的println()也是方法的重载,根据传入的数类型,个数不同,从而调用不 阅读全文
posted @ 2021-09-30 11:42 慢漫曼蔓 阅读(42) 评论(0) 推荐(0)
摘要: 最近,读了《程序员修炼之道:从小工到专家》,感慨颇多。 本书第一章是注重时效的哲学,告诉了我们责任的重要性,提醒我们不要留着“破窗户”(低劣的设计、错误的决策、糟糕的代码)不修。石头汤与煮青蛙的故事告诉了我们团结的力量,不要忽略小事情,要时刻注意周围发生的事情,不要只局限于自己所在的事情。这也是我自 阅读全文
posted @ 2021-09-29 18:23 慢漫曼蔓 阅读(28) 评论(0) 推荐(0)