a) Define your class to be Generic
public class TestModel<K>{
b) no need for the generic near the public
public void add(K fieldType, K value)//remove the 'public<K>'
Type: Posts; User: copeg
a) Define your class to be Generic
public class TestModel<K>{
b) no need for the generic near the public
public void add(K fieldType, K value)//remove the 'public<K>'
May or may not suit this scenario, but you could extend one of the types from the other
public class MyClass<V, T extends V>{
///my class
public void function(V v, T t){
}
}