2017年8月18日

简单取随机数

摘要: //取随机数 Random random=new Random(); int a=random.nextInt(3);//取0-3的随机数 阅读全文

posted @ 2017-08-18 10:23 java羊羔 阅读(165) 评论(0) 推荐(0) 编辑

2017年8月11日

Thread:多线程 实现简单购票

摘要: public class duoXiCheng extends Thread{ //继承Thread类 //定义一个票数的变量 static 静态的 公用的 票数 static int tickets = 100; // public duoXiCheng() { super(); // TODO 阅读全文

posted @ 2017-08-11 23:51 java羊羔 阅读(278) 评论(0) 推荐(0) 编辑

java:FileOutputStream 字节流输出空文件

摘要: /* 需要用到的包 */ import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException; public class javayang001{ //写一个类 带主方法 pu 阅读全文

posted @ 2017-08-11 00:31 java羊羔 阅读(2521) 评论(0) 推荐(0) 编辑

2017年8月7日

java正则表达式(基本语法)

摘要: Public class cla001{ public int countCode(String a){ //表达式(找出"conxe"中的字符,其中'x'为任意字符) String b= "co(.)e"; //表达式写入匹配器 Pattern p = Pattern.compile(b); // 阅读全文

posted @ 2017-08-07 17:26 java羊羔 阅读(226) 评论(0) 推荐(1) 编辑

导航