Classes compatibility

M

Maxim Geraskyn

Hi there,

Simple example.

a.jar includes A class
b.jar includes B class inherited from A

If I add new methods/fields to A class and recreate a.jar, will
b.jar still normally work with old fields/methods of A
( so b.jar sees new version of a.jar but compiled with old one)

Are there well-defined compatibility rules about it ?

Thanks in advance,

Maxim
 
A

Andrea Desole

Maxim said:
Hi there,

Simple example.

a.jar includes A class
b.jar includes B class inherited from A

If I add new methods/fields to A class and recreate a.jar, will
b.jar still normally work with old fields/methods of A
( so b.jar sees new version of a.jar but compiled with old one)

Are there well-defined compatibility rules about it ?

check out the specs:

"Changing the direct superclass or the set of direct superinterfaces of
a class type will not break compatibility with pre-existing binaries,
provided that the total set of superclasses or superinterfaces,
respectively, of the class type loses no members."

from this url:

http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#44994
 

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

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top