Thanks to everyone that respond.
I think that i made a confusion in general about different concept in java.
1 Concept
If i implements an interface from a class i should override all the method of the interface at my class. So at my class i will override method.
2 Concept
if i desire to use a parametrized type as a method parameter in a generic method i should define it as parameter type of the interface otherelse i will receive compile error.
//i passed B as Parameter to my interface and i use it at my method as parameter
public interface ICOperations<B> {
<A> A findById(B b);
//i don't passed the B as parameter type at my interface so when i passed it as method parameter the compiler say to me that i dont know the symbol B.
public interface ICOperations {
<A> A findById(B b);
If i dont define a letter at my interface definition (in my case i have only A and B :
public interface ICOperations<A,B>
but i need to create a new letter i need to use the diamond annotation ( and here we arrive at the point that i say about the letter G.
<G> G deleteById(A a);
In this case we totally loose the Type Safety because it has no connection with the interface itself.
When we create a Generic Interface ( in my case: public interface ICOperations<A,B>
i am defining that this interface will be composed from two type ( A and B ) and every class that will implement my interface shoud define the type to substitute A and B.
I create a class called Operations: public class Operations implements<Integer,String>
,
Now i have the definition of the interface as this:
public interface ICOperations<A,B>{
A findById(B b)
}
and the definition of my class as:
public class Operations implements<Integer,String>
And when i override my method i should define :
public class Operations implements ICOperations<Integer,String>
@Overrided
Integer deleteById(String id){
//some code here
}