interface implementation and binary compability

M

Maciek Zywno

hello

I am reading "effective java programming" by Josh Bloch and got one
question concerning "applying interfaces as a mean to use constants"
toppic, let's consider a following piece of code:

interface MyConstants{
static final MY_NUMBER = 7;
}

class INeedMyConstantClass implements MyConstants{
//here I can use MY_NUMBER
}

one mistake with such solution is that when class author creates a new
version of a class that no more needs that constant to accomplish its
business method, this class still has to implement the interface to
assure binary compability with a client (hope I properly translated the
sentence into english)

what does binary compability means in this case?
for me client should not bother what interface is implemented because it
refers to an object by means to a class reference and not by an the
interface reference

can you explain this to me?

regards

maciek zywno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top