进阶day02-泛型接口的使用

This commit is contained in:
2026-01-31 14:11:09 +08:00
parent 787e103e2e
commit 6d0a68cf23
4 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package com.inmind.generic_interface05;
public class Demo06 {
public static void main(String[] args) {
//创建实现类2对象
MyInterfaceImpl2<Integer> impl2 = new MyInterfaceImpl2<>();
impl2.method1(1);
Integer i = impl2.method2();
}
}