Compare commits
1 Commits
wsm_branch
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
9f8ed2adb2 | 4 days ago |
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
package generics;
|
||||
|
||||
public class GenericsDemo {
|
||||
public static void main(String[] args) {
|
||||
Demo d = new Demo(); //实例化Demo对象
|
||||
String str = d.fun("汤姆");//传递字符串
|
||||
int i = d.fun(30); //传递数字,自动装箱
|
||||
System.out.println(str); //输出内容
|
||||
System.out.println(i); //输出内容
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue