public<T,G> Map<T,G> fullfillExistUrlMap(){ Map<T,G> map = new HashMap<T,G>(); jdbcTemplate.query("", new PreparedStatementSetter() { @Override public void setValues(PreparedStatement arg0) throws SQLException { } }, new ResultSetExtractor<T>() { @Override public T extractData(ResultSet arg0) throws SQLException, DataAccessException { return null; } }); return map; }public<T,G> Map<T,G> methodName();
<T,G>的定義能夠在public後,也能夠在定義class的時候定義: java
public final class Class<T> implements java.io.Serializable, java.lang.reflect.GenericDeclaration, java.lang.reflect.Type, java.lang.reflect.AnnotatedElement這兒<T>放在public,final,class後面都是不能夠的,編譯通不過。