随笔分类 - 前端歌谣--学习篇-java基本语法
java基本语法
摘要://arraylist的遍历和增加 import java.util.ArrayList; public class test37 { public static void main(String[] args){ ArrayList aa1=new ArrayList(); //当前对象个数 Sy
阅读全文
摘要://集合类的作用 public class test35 { private String name; private int num; private int grade; public test35(String name,int num,int grade){ this.name=name;
阅读全文
摘要:/Character包装类 public class test23 { public static void main(String[] args){ char ch='A'; //使用构造方法 Character obj1=new Character('中'); //使用静态方法 Characte
阅读全文
摘要://买票问题 class Xc9 implements Runnable{ public static int chepiao=100; static String aa=new String("1");//字符串随意定义,定义在函数上面 public void run(){ while (true
阅读全文
摘要:public class test33 { public static void main(String[] args) { Xc46 xc46=new Xc46(); Thread dd = new Thread(xc46); dd.start(); try { dd.join(); } catc
阅读全文
摘要:public class test32 { public static void main(String[] args){ Thread xc13=new Thread(new Xc44()); Thread xc14=new Thread(new Xc44()); xc13.setName("线程
阅读全文
摘要://线程的睡眠 public class test31 { public static void main(String[] args){ Xc43 xc43=new Xc43(); Thread ccc=new Thread(xc43); ccc.start(); } } class Xc43 i
阅读全文
摘要:public class test30 { public static void main(String[] args){ Thread xc11=new Thread(new Xc41()); Thread xc12=new Thread(new Xc42()); xc11.setPriority
阅读全文
摘要://创建线程 class Xc3 extends Thread { public void run(){ System.out.println("当前线程的名称为"+Thread.currentThread().getName()); } } public class test29{ public
阅读全文
摘要://创建线程的第二种方法 class Xc2 implements Runnable { public void run(){ for (int i=0;i<20;i++){ System.out.println("我是歌谣"); } } } public class test28{ public
阅读全文
摘要://线程的创建方法1 class Xc extends Thread { public void run(){ for (int i=0;i<20;i++){ System.out.println("我是歌谣"); } } } public class test27{ public static v
阅读全文
摘要://System类 import java.util.Date; import java.util.Properties; public class test26 { public static void main(String[] args){ testOut(-1); //获取系统时间 long
阅读全文
摘要://Character方法大小写转换 public class test25 { public static void main(String[] args) { char ch = 'A'; //使用构造方法 Character obj1 = new Character('中'); //使用静态方
阅读全文
摘要://Character方法数量统计 public class test24 { public static void main(String[] args) { char ch = 'A'; //使用构造方法 Character obj1 = new Character('中'); //使用静态方法
阅读全文
摘要:public class test22 { public static void main(String[] args){ int num=5; Integer obj1=new Integer(num); System.out.println("obj1的值为"+obj1); Integer ob
阅读全文
摘要:public class test22 { public static void main(String[] args){ int num=5; Integer obj1=new Integer(num); System.out.println("obj1的值为"+obj1); Integer ob
阅读全文
摘要:测试类 public class test22 { public static void main(String[] args){ int num=5; Integer obj1=new Integer(num); System.out.println("obj1的值为"+obj1); Intege
阅读全文
摘要://object常用方法 public class test21 { public static void main(String[] args) { Object obj = new Object(); ObjectCl usr = new ObjectCl(); usr.setAge(6); u
阅读全文
摘要://常用基础类 public class ObjectClass { private String name; private int age; public void say(){ System.out.println(name); System.out.println(age); } publi
阅读全文
摘要://静态代码块内部类 public class test18{ private static final String URL; private static final String DEVICE; private static final String USER; private static
阅读全文