Autofac创建实例的方法总结 1.InstancePerDependency 对每一个依赖或每一次调用创建一个新的唯一的实例.这也是默认的创建实例的方式. 官方文档解释:Configure the component so that every dependent component or call to Resolve() gets a new, unique instance (default.) 2.InstancePerLifetimeScope 在一个生命周期域中,每一个依赖或
静态只能调用静态 非静态: 对象名.方法名 package ti; //通过两个类 StaticDemo.LX4_1 说明静态变量/方法与实例变量/方法的区别. class StaticDemo { static int x; int y; public static int getX() { return x;//静态方法中可以访问静态数据成员x } public static void setX(int newX) { x = newX; } public int getY() {//int