随笔分类 -  Java SE 编程练习

demo
摘要:import java.util.regex.*; public class RegPlus{ public static void main(String[] args){ //group(); //reference(); flags(); } //non-capturing groups 非捕 阅读全文
posted @ 2020-04-02 20:52 yxfyg 阅读(126) 评论(0) 推荐(0)
摘要:import java.util.regex.*; public class RegQuantifiers{ public static void main(String[] args){ greedy(); reluctant(); possessive(); } public static vo 阅读全文
posted @ 2020-04-02 17:42 yxfyg 阅读(171) 评论(0) 推荐(0)
摘要:import java.io.*; import java.util.regex.*; public class RegEmail{ public static void main(String[] args){ try{ BufferedReader br = new BufferedReader 阅读全文
posted @ 2020-04-02 14:42 yxfyg 阅读(201) 评论(0) 推荐(0)
摘要:import java.util.regex.*; public class RegGroup{ public static void main(String[] args){ Pattern p = Pattern.compile("([a-z]{2,4})(\\d+)"); Matcher m 阅读全文
posted @ 2020-04-02 12:32 yxfyg 阅读(349) 评论(0) 推荐(0)
摘要:import java.util.regex.*; public class RegReplace{ public static void main(String[] args){ Pattern p = Pattern.compile("java",Pattern.CASE_INSENSITIVE 阅读全文
posted @ 2020-04-02 11:31 yxfyg 阅读(401) 评论(0) 推荐(0)
摘要:import java.util.regex.*; public class RegExp{ public static void main(String[] args){ System.out.println("32323232@qq.com".matches("[\\w[.-]]+@[\\w[. 阅读全文
posted @ 2020-04-02 11:14 yxfyg 阅读(175) 评论(0) 推荐(0)
摘要:import java.util.*; import java.sql.Timestamp; import java.text.*; public class TestSimpleDateFormat{ public static void main(String[] args){ Date now 阅读全文
posted @ 2020-03-30 10:11 yxfyg 阅读(315) 评论(0) 推荐(0)
摘要:import java.lang.reflect.*; public class TestReflection{ public static void main(String[] args) throws Exception{ String str = "T"; Class c = Class.fo 阅读全文
posted @ 2020-03-16 15:59 yxfyg 阅读(170) 评论(0) 推荐(0)
摘要:import java.net.*; import java.io.*; public class UDPServer{ public static void main(String[] args){ try{ byte[] buf = new byte[100]; DatagramPacket d 阅读全文
posted @ 2020-03-08 14:07 yxfyg 阅读(108) 评论(0) 推荐(0)
摘要:import java.net.*; import java.io.*; public class TCPServer{ public static void main(String[] args){ try{ ServerSocket ss = new ServerSocket(6666); wh 阅读全文
posted @ 2020-03-06 15:42 yxfyg 阅读(228) 评论(0) 推荐(0)
摘要:public class ProducerConsumer{ public static void main(String[] args){ SyncStack ss = new SyncStack(); Producer p = new Producer(ss); Consumer c = new 阅读全文
posted @ 2020-03-06 08:35 yxfyg 阅读(125) 评论(0) 推荐(0)
摘要:public class TestSync implements Runnable{ int num = 100; public static void main(String[] args){ TestSync syn = new TestSync(); Thread t = new Thread 阅读全文
posted @ 2020-03-05 18:07 yxfyg 阅读(103) 评论(0) 推荐(0)
摘要:public class DeadLock implements Runnable{ int flag = 1; static Object o1 = new Object(); static Object o2 = new Object(); public static void main(Str 阅读全文
posted @ 2020-03-05 16:15 yxfyg 阅读(226) 评论(0) 推荐(0)
摘要:public class TestSynchronized implements Runnable{ Timer timer = new Timer(); public static void main(String[] args){ TestSynchronized syn = new TestS 阅读全文
posted @ 2020-03-05 11:22 yxfyg 阅读(397) 评论(0) 推荐(0)
摘要:public class TestJoin{ public static void main(String[] args){ Thread t = new Thread(new MyRunner()); t.start(); try{ t.join(); } catch(InterruptedExc 阅读全文
posted @ 2020-03-05 09:44 yxfyg 阅读(167) 评论(0) 推荐(0)
摘要:import java.util.*; public class TestInterrupted{ public static void main(String[] args){ Thread t = new MyThread(); t.start(); try{ Thread.sleep(1000 阅读全文
posted @ 2020-03-04 16:19 yxfyg 阅读(131) 评论(0) 推荐(0)
摘要:public class TestThread{ public static void main(String[] args){ MyRunner r = new MyRunner(); Thread t = new Thread(r); t.start(); for(int i=0;i<100;i 阅读全文
posted @ 2020-03-04 15:24 yxfyg 阅读(153) 评论(0) 推荐(0)
摘要:import java.io.*; import java.util.*; public class ObjectSerializable{ public static void main(String[] args){ try{ ObjectOutputStream oos = new Objec 阅读全文
posted @ 2020-03-04 08:53 yxfyg 阅读(380) 评论(0) 推荐(0)
摘要:import java.io.*; import java.util.*; public class SimpleLog{ public static void main(String[] args){ try{ BufferedReader br = new BufferedReader(new 阅读全文
posted @ 2020-03-03 17:48 yxfyg 阅读(89) 评论(0) 推荐(0)
摘要:import java.io.*; public class ChangeOut{ public static void main(String[] args){ try{ FileOutputStream fos = new FileOutputStream("D:/Java/ChangeOut/ 阅读全文
posted @ 2020-03-03 17:08 yxfyg 阅读(304) 评论(1) 推荐(0)