This is TestClass A: com.zwt.demo.util.TestClassA@2c768ada This is TestClass B: com.zwt.demo.util.TestClassB@c1fca2a This is TestClass A: com.zwt.demo.util.TestClassA@2c768ada This is TestClass B: com.zwt.demo.util.TestClassB@c1fca2a This is TestClass A: com.zwt.demo.util.TestClassA@2c768ada This is TestClass B: com.zwt.demo.util.TestClassB@c1fca2a This is TestClass A: com.zwt.demo.util.TestClassA@2c768ada This is TestClass B: com.zwt.demo.util.TestClassB@c1fca2a This is TestClass A: com.zwt.demo.util.TestClassA@2c768ada This is TestClass B: com.zwt.demo.util.TestClassB@c1fca2a
This is TestClass A: com.zwt.demo.util.TestClassA@7c447c76 This is TestClass B: com.zwt.demo.util.TestClassB@1640c151 This is TestClass A: com.zwt.demo.util.TestClassA@7c447c76 This is TestClass B: com.zwt.demo.util.TestClassB@5d5b5fa7 This is TestClass A: com.zwt.demo.util.TestClassA@7c447c76 This is TestClass B: com.zwt.demo.util.TestClassB@2a32fb6 This is TestClass A: com.zwt.demo.util.TestClassA@7c447c76 This is TestClass B: com.zwt.demo.util.TestClassB@6107165 This is TestClass A: com.zwt.demo.util.TestClassA@7c447c76 This is TestClass B: com.zwt.demo.util.TestClassB@164a62bf
@Component publicclassTestClassA{ @Lookup public TestClassB getTestClassB(){ returnnull; } publicvoidprintClass(){ System.out.println("This is TestClass A: " + this); getTestClassB().printClass(); } }
我们运行测试类,可以看到输出结果:
1 2 3 4 5 6 7 8 9 10
This is TestClass A: com.zwt.demo.util.TestClassA$$EnhancerBySpringCGLIB$$a967ae38@5a00eb1e This is TestClass B: com.zwt.demo.util.TestClassB@1aac188d This is TestClass A: com.zwt.demo.util.TestClassA$$EnhancerBySpringCGLIB$$a967ae38@5a00eb1e This is TestClass B: com.zwt.demo.util.TestClassB@7026b7ee This is TestClass A: com.zwt.demo.util.TestClassA$$EnhancerBySpringCGLIB$$a967ae38@5a00eb1e This is TestClass B: com.zwt.demo.util.TestClassB@2d23faef This is TestClass A: com.zwt.demo.util.TestClassA$$EnhancerBySpringCGLIB$$a967ae38@5a00eb1e This is TestClass B: com.zwt.demo.util.TestClassB@7cb8437d This is TestClass A: com.zwt.demo.util.TestClassA$$EnhancerBySpringCGLIB$$a967ae38@5a00eb1e This is TestClass B: com.zwt.demo.util.TestClassB@62a4417