package test.arithmetic;/** * 接口中定义泛型 * @author Administrator * */public class Arithmetic1 { /** * @param args */ public static void main(String[] args) { Point p=new PointImpl ("20度,110度"); print(p); } public static void print(Object p){ System.out.println(p); } }interface Point { public T getPoint();}class PointImpl implements Point { private T point; public PointImpl(T point){ this.setPoint(point); } public void setPoint(T point){ this.point=point; } @Override public T getPoint() { return point; } @Override public String toString() { // TODO Auto-generated method stub return point.toString(); } }