04 2022 档案

摘要:import dd.com.MyService; import dd.com.start.StartOk; module one { exports cc.com; exports dd.com; provides MyService with StartOk; } import dd.com.My 阅读全文
posted @ 2022-04-28 22:33 phpwyl 阅读(100) 评论(0) 推荐(0) 编辑
摘要:package Reflects; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Constructor; import java. 阅读全文
posted @ 2022-04-28 21:37 phpwyl 阅读(171) 评论(0) 推荐(0) 编辑
摘要:package Reflects; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import jav 阅读全文
posted @ 2022-04-28 20:35 phpwyl 阅读(49) 评论(0) 推荐(0) 编辑
摘要:package Reflects; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; /** * 通过反射 阅读全文
posted @ 2022-04-27 22:38 phpwyl 阅读(53) 评论(0) 推荐(0) 编辑
摘要:package Reflects; public class ReflectDemo{ public static void main(String[] args) throws ClassNotFoundException { Class<Actor> ac1 = Actor.class; Sys 阅读全文
posted @ 2022-04-27 21:06 phpwyl 阅读(125) 评论(0) 推荐(0) 编辑
摘要:package Streams; import java.util.ArrayList; /** * 需求,按照下面的要求完成集合的创建和遍历 * 创建一个集合存储多个字符串元素 * 把集合中所有以张开头的元素存储到一个新的集合 * 把:张 开头的集合中长度为3⃣️的元素存储到一个新的集合 * 遍历 阅读全文
posted @ 2022-04-25 22:39 phpwyl 阅读(21) 评论(0) 推荐(0) 编辑
摘要:package com; import java.util.function.Function; public class FuctionDemo { public static void main(String[] args) { convert("100",s -> Integer.parseI 阅读全文
posted @ 2022-04-25 21:58 phpwyl 阅读(6387) 评论(0) 推荐(0) 编辑
摘要:package com.runnable; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; public class ComparatorDemo { public stat 阅读全文
posted @ 2022-04-24 21:39 phpwyl 阅读(498) 评论(0) 推荐(0) 编辑
摘要:package com.interfaces; public class Demo3 { public static void main(String[] args) { test((name, age) -> new Student(name,age)); test(Student::new); 阅读全文
posted @ 2022-04-23 20:40 phpwyl 阅读(64) 评论(0) 推荐(0) 编辑
摘要:package com.interfaces; public class PrinterDemo { public static void main(String[] args) { usePrinter((String s)->{ System.out.println(s.toUpperCase( 阅读全文
posted @ 2022-04-23 17:55 phpwyl 阅读(75) 评论(0) 推荐(0) 编辑
摘要:package com.interfaces; public class Demo2 { public static void main(String[] args) { start(s-> Integer.parseInt(s)); //引用类方法 start( Integer::parseInt 阅读全文
posted @ 2022-04-23 17:42 phpwyl 阅读(11) 评论(0) 推荐(0) 编辑
摘要:package com.interfaces; public interface Inter { void show(); default void method(){ System.out.println("默认方法"); } public static void test(){ System.o 阅读全文
posted @ 2022-04-23 11:51 phpwyl 阅读(986) 评论(0) 推荐(0) 编辑
摘要:package com.interfaces; public interface InterfaceOne { void aa(); void bb(); default void cc(){ } } 默认方法不是抽象方法,所以不被强制重写,但可以被重写,重写时候要去掉default关键字 publ 阅读全文
posted @ 2022-04-23 09:42 phpwyl 阅读(195) 评论(0) 推荐(0) 编辑
摘要:package lambda; public interface Addable { int add(int x,int y); } package lambda; public class AddableDemo { public static void main(String[] args) { 阅读全文
posted @ 2022-04-18 21:07 phpwyl 阅读(27) 评论(0) 推荐(0) 编辑
摘要:package Inter; import java.io.*; import java.net.ServerSocket; import java.net.Socket; public class ServeDemo { public static void main(String[] args) 阅读全文
posted @ 2022-04-17 15:49 phpwyl 阅读(25) 评论(0) 推荐(0) 编辑
摘要:package Inter; import java.io.*; import java.net.Socket; public class ClientDemo { public static void main(String[] args) throws IOException { Socket 阅读全文
posted @ 2022-04-17 14:04 phpwyl 阅读(91) 评论(0) 推荐(0) 编辑
摘要:package Inter; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.DatagramPacket; import jav 阅读全文
posted @ 2022-04-14 22:40 phpwyl 阅读(38) 评论(0) 推荐(0) 编辑
摘要:package Inter; import java.io.IOException; import java.net.*; public class InetAddressDemo { public static void main(String[] args) throws IOException 阅读全文
posted @ 2022-04-13 22:50 phpwyl 阅读(131) 评论(0) 推荐(0) 编辑
摘要:package Multithreading; import java.util.*; public class BuyTicketDemo { public static void main(String[] args) { StringBuffer sb = new StringBuffer() 阅读全文
posted @ 2022-04-07 22:48 phpwyl 阅读(39) 评论(0) 推荐(0) 编辑
摘要:package Multithreading; /* 出现数据安全的原因 1。是否是多线程环境 2。是否是共享数据 3。是否有多条语句操作共享数据(打破此条件) 同步代码块的好处和弊端 好处:解决了多线程的数据安全问题 弊端:当线程很多时,因为每个线程都会去判断同步上的锁,这里很耗资源的,无形中会降 阅读全文
posted @ 2022-04-07 21:59 phpwyl 阅读(98) 评论(0) 推荐(0) 编辑
摘要:package Multithreading; public class MyRunnableDemo { public static void main(String[] args) { MyRunnable myRunnable = new MyRunnable(); Thread thread 阅读全文
posted @ 2022-04-07 20:34 phpwyl 阅读(17) 评论(0) 推荐(0) 编辑
摘要:package Multithreading; public class MyThreadDemo { public static void main(String[] args) { MyThread my1 = new MyThread("飞机"); MyThread my2 = new MyT 阅读全文
posted @ 2022-04-05 21:58 phpwyl 阅读(18) 评论(0) 推荐(0) 编辑
摘要:package Iodemo; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.ut 阅读全文
posted @ 2022-04-05 18:23 phpwyl 阅读(19) 评论(0) 推荐(0) 编辑
摘要:package Iodemo; import java.io.*; public class ObjectInputStreamDemo { public static void main(String[] args) throws IOException, ClassNotFoundExcepti 阅读全文
posted @ 2022-04-05 16:49 phpwyl 阅读(23) 评论(0) 推荐(0) 编辑
摘要:package Iodemo; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectOutputStream; public cl 阅读全文
posted @ 2022-04-05 15:30 phpwyl 阅读(23) 评论(0) 推荐(0) 编辑
摘要:package Iodemo; import java.io.*; public class CopyAllDemo { public static void main(String[] args) throws IOException { File f = new File("/Volumes/m 阅读全文
posted @ 2022-04-05 13:05 phpwyl 阅读(64) 评论(0) 推荐(0) 编辑
摘要:package Iodemo; import java.io.*; /** * 复制单级目录 */ public class CopyOneDir { public static void main(String[] args) throws IOException { File srcFolder 阅读全文
posted @ 2022-04-04 10:57 phpwyl 阅读(22) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示