package com.shrimpking.t6;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/10/1 14:21
*/
class Graph3<T>{
private T shape;
public T getShape()
{
return shape;
}
public void setShape(T shape)
{
this.shape = shape;
}
}
public class WildcardProblem8_5
{
public void display(Graph3<Integer> gint){
System.out.println(gint.getShape());
}
public static void main(String[] args)
{
Graph3<Integer> gaInt = new Graph3<>();
Graph3<String> gaStr = new Graph3<>();
WildcardProblem8_5 wp = new WildcardProblem8_5();
wp.display(gaInt);
//wp.display(gaStr); //提示不兼容
}
}
WildcardProblem8_5
最新推荐文章于 2025-01-16 23:49:26 发布
25

被折叠的 条评论
为什么被折叠?



