所需软件:Splashtop_Wired_XDisplay_Agent(PC端)XDisplay(在苹果商城搜索下载 蓝色图标)下载URL:https://www.splashtop.com/wiredxdisplay使用:在PC端打开Splashtop Wired XDisplay Agent与在iPad上打开XDisplay运行,然后用数据线将iPad连电脑即可。点Windows10右下角按钮,选“投影”,选择合适投影方式即可。使用感受比较方便不需要流量,无缝将电脑屏幕拓展到iPad上,只是iPad屏幕还是有点小,凑合吧。投影后的iPad屏幕支持触屏操作,但不支持按键操作。若需按键操作可下载同公司下的另一款软件:Splashtop(iPad上下载),Splashtop Streamer(PC上下载)下载URL:https://www.splashtop.com/downloadstart?platform=auto安卓平板/手机下载URL:https://a.app.qq.com/o/simple.jsp?pkgname=com.splashtop.xdisplay.wired.pro&g_f=undefined
Lamada函数式接口概念:有且仅有一个抽象方法的接口由于只有一个抽象方法 Lamada才能顺利推导@FunctionalInterface放在该接口上强制检查接口是否只有一个抽象方法 否则保存当然符合有且仅有一个抽象方法也不用加该注解Lamada示例接口中public abstract可以省略@FunctionalInterfacepublic interface MyFunctionalInterface { public abstract void myMethod(String s);}个人理解为调用接口时重写抽象方法有返回值示例-定义接口@FunctionalInterfacepublic interface Sumable { int sum(int a, int b);}定义处理方法private static void showSum(int x, int y, Sumable sumCalculator) { System.out.println(sumCalculator.sum(x, y));}在Main方法中调用showSum(10, 20, (m,n)->m + n);不写处理方法直接写匿名内部类形式比较容易理解Sumable sumable = new Sumable() { @Override public int sum(int a, int b) { return a + b; }};System.out.println(sumable.sum(20, 30));后一种改成Lamada形式Sumable sumable = (a, b) -> a + b;System.out.println(sumable.sum(20, 30));函数式编程Lambda延迟加载性能浪费实例public class Demo01Logger{ private static void log(int level, String msg) { if (level == 1) { System.out.println(msg); } } public static void main(String[] args) { String msgA = "Hello"; String msgB = "World"; String msgC = "Java"; log(1, msgA + msgB + msgC); }}原因调用方法时候优先拼接了字符串无论条件是否符合都拼接了解决改Lamada形式定义接口@FunctionalInterface public interface MessageBuilder { String buildMessage(); }改造方法public class Demo02LoggerLambda{ private static void log(int level, MessageBuilder builder) { if (level == 1) { System.out.println(builder.buildMessage()); } } public static void main(String[] args) { String msgA = "Hello"; String msgB = "World"; String msgC = "Java"; log(1, () ‐ > msgA + msgB + msgC ); }}类似:SLF4J会在满足日志级别时进行字符串拼接LOGGER.debug("变量{}的取值为{}。", "os", "macOS")Lamada作参数与返回值