摘要:
配置GOPATH环境变量 project文件夹 在project文件夹新建3个文件夹 src 存放go语言源码 pkg 存放编译好的包对象文件 bin 存放链接好的可执行文件 新建项目 在src文件夹下新建项目\golearn\ch2\main.go 将源码编译成可执行文件 在project路径下打 阅读全文
posted @ 2022-10-03 23:18
jarico
阅读(450)
评论(0)
推荐(0)
摘要:
新建函数接口 Operation @FunctionalInterface public interface Operation<R, T> { R operator (T t1, T t2); } 在测试类中实现 public class TestDemo { @Test public void 阅读全文
posted @ 2022-10-03 21:14
jarico
阅读(22)
评论(0)
推荐(0)
摘要:
default关键字 定义一个Animal接口 其中breath用default修饰。 public interface Animal { void run(); void eat(); default void breath(){ System.out.println("呼吸"); } } 定义一 阅读全文
posted @ 2022-10-03 18:24
jarico
阅读(25)
评论(0)
推荐(0)
摘要:
结构图 Subject public interface Subject { void request(); } RealSubject public class RealSubject implements Subject{ @Override public void request() { Sy 阅读全文
posted @ 2022-10-03 12:15
jarico
阅读(26)
评论(0)
推荐(0)
摘要:
结构图 Srategy abstract class Strategy { public abstract void AlgorithmInterface(); } ConcreteStrategyA public class ConcreteStrategyA extends Strategy{ 阅读全文
posted @ 2022-10-03 11:22
jarico
阅读(24)
评论(0)
推荐(0)

浙公网安备 33010602011771号