Is this homework? If so stop reading. :)
Three things are happening:
1) You are creating a new variable that will point to an object implementing
the "B" interface. You will only be able to call methods on this variable
that are in "B" or "B"'s ancestors.
2) You are creating a new object of type "L", passing in xyz to the
constructor.
3) You are assigning the object created in 2) above to the variable of type
"B" from 1) above. Because L implements B (can be treated as a "B"), this
assignment succeeds.
You can now call the interface methods defined in B on this object, which
happens to be of type L without performing any casting.
"Patrick De Ridder" <00@00.00> wrote in message
news:10***************@news-01.evisp.enertel.nl...
B is an interface
L implements B
What is happening here?
B l = new L (xyz);
Thanks,
Patrick.