Tell me more ×  I feel like I should know this, but can't really
explain it when asked. I have a method:  public <T extends
IByteConverter<T>> int write(T obj) throws IOException {
byte[] byteArray = obj.toByteArray();     //keeps track of size
of what was written     return byteArray.length;  and my
interface:  interface IByteConverter<T> {     public byte[]
toByteArray();     public T fromByteArray(byte[] byteArray);
When I call obj.toByteArray(), How does my program know what to
do? No where in my class do I actually implement the code in
IByteConverter, but the program works just as expected. Is there
a simple way to explain what is going on?  share|improve this
question By saying that it works, you actually mean it compiles
right? –  Rohit Jain Nov 30 '12 at 20:36 Yes, compliles and
works as expected. Meaning it returns the object passed in, into
a byte[]. –  btjordan23 Nov 30 '12 at 20:37 add comment  2
Answers  up vote 3 down vote accepted  Let's make the thing
easier to understand with another ex