摘要: //String方法 public class test41 { //比较两个人的姓名是否相同 public static boolean eqName(String name1,String name2){ return name2.equals(name1)?true:false; } //按照 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(84) 评论(0) 推荐(0)
摘要: //字符串概述 public class test40 { public static void main(String[] args){ char[] str1={'1','2','3','4','5','6','7','8','9'}; String str2=new String("我是歌谣" 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(23) 评论(0) 推荐(0)
摘要: arraylist的查询和删除 //arraylist的遍历和增加 import java.util.ArrayList; public class test38 { public static void main(String[] args){ ArrayList aa1=new ArrayLis 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(34) 评论(0) 推荐(0)
摘要: //arraylist的遍历和增加 import java.util.ArrayList; public class test37 { public static void main(String[] args){ ArrayList aa1=new ArrayList(); //当前对象个数 Sy 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(35) 评论(0) 推荐(0)
摘要: //集合类的作用 public class test35 { private String name; private int num; private int grade; public test35(String name,int num,int grade){ this.name=name; 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(28) 评论(0) 推荐(0)
摘要: /Character包装类 public class test23 { public static void main(String[] args){ char ch='A'; //使用构造方法 Character obj1=new Character('中'); //使用静态方法 Characte 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(39) 评论(0) 推荐(0)
摘要: //买票问题 class Xc9 implements Runnable{ public static int chepiao=100; static String aa=new String("1");//字符串随意定义,定义在函数上面 public void run(){ while (true 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(26) 评论(0) 推荐(0)
摘要: public class test33 { public static void main(String[] args) { Xc46 xc46=new Xc46(); Thread dd = new Thread(xc46); dd.start(); try { dd.join(); } catc 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(76) 评论(0) 推荐(0)
摘要: public class test32 { public static void main(String[] args){ Thread xc13=new Thread(new Xc44()); Thread xc14=new Thread(new Xc44()); xc13.setName("线程 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(20) 评论(0) 推荐(0)
摘要: //线程的睡眠 public class test31 { public static void main(String[] args){ Xc43 xc43=new Xc43(); Thread ccc=new Thread(xc43); ccc.start(); } } class Xc43 i 阅读全文
posted @ 2022-06-25 15:26 前端导师歌谣 阅读(24) 评论(0) 推荐(0)