摘要: 问题:求某个区间中的多少个数 例:求【10,23】之间10个整数 public class Four { // 重写random中的nextint方法 private static int random(int min,int max) { Random r1 = new Random(); ret 阅读全文
posted @ 2020-01-13 20:26 墙角有只鬼 阅读(243) 评论(0) 推荐(0)
摘要: indexOf()方法: 空格、大写字母,都会重新计算索引位置,用逆序遍历的方法可以实现输出最后一次索引的位置 阅读全文
posted @ 2020-01-13 13:06 墙角有只鬼 阅读(390) 评论(0) 推荐(0)
摘要: //String常用方法 public class Demo1 { public static void main(String[] args) { //1.测试此字符串是否以指定的前缀开始 // public boolean startWith(String s) String s1 = "hel 阅读全文
posted @ 2020-01-13 11:45 墙角有只鬼 阅读(261) 评论(0) 推荐(0)
摘要: //StringBuffer:可变字符序列,一个类似与String的字符缓冲区 /*特点: * 1.可以对字符串进行修改 * 2.长度是可变的 * */ public class Demo2 { public static void main(String[] args) { /*构造: Strin 阅读全文
posted @ 2020-01-13 11:41 墙角有只鬼 阅读(188) 评论(0) 推荐(0)