Hey All,
First off, hello. I'm new to the
Java world. My team recently lost its only engineer, so we've been tasked to maintain our
servlet code. Needless to say, I've been hitting the books.
I decided to get into the game by reading "Head First Java", and the following code snippet baffled me. There is no explanation, so I thought I'd post my question to the forums.
First off, here's a bit of the code:
The Nose array is killing me. I had learned that interfaces are great way of providing multiple inheritance. I've always assumed that interfaces were not meant to be instanced. In the above example, I see that the reference variable is creating an array of Noses. Is this just a bizzare way of referencing the Clowns class? The array is ultimately filled with Clown objects. Why would any one do this?
If you have the book, the example is on the last page of Chapter 8 (234). I'm just curious. Any perspectives on this issue is welcome.
Cheers!
Brian