{
private T var;
public Info(T var)
{
this.setVar(var);
}
public void setVar(T var)
{
this.var = var;
}
public T getVar()
{
return this.var;
}
}
class Da<S>
{
private S vars;
public Da(S vars)
{
this.setVars(vars);
}
public void setVars(S vars)
{
this.vars = vars;
}
public S getVars()
{
return this.vars;
}
}
public class Demo109
{
public static void main(String args[])
{
Info<String> info = null;
Da<Info<String>> da = null;
info = new Info<String> ("nima"); //原来粗心写成info = new <String>Info ("nima"),出现了下面的提示,要注意格式
da = new Da <Info<String>> (info);
System.out.println(da.getVars().getVar());
}
}