泛型之前 public class booleanFoo private Boolean fooi public void setFoo(Boolean foo) this foo =foo; public Boolean getFoo( return foo public class IntegerFoo i private Integer foo public void set Foo(Integer foo ) i this. fo fo public Integer getFoo ( return foo没有泛型之前 public class BooleanFoo { private Boolean foo; public void setFoo(Boolean foo) { this.foo = foo; } public Boolean getFoo() { return foo; } } public class IntegerFoo { private Integer foo; public void setFoo(Integer foo) { this.foo = foo; } public Integer getFoo() { return foo; } }