Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Classes compatibility

Reply
Thread Tools

Classes compatibility

 
 
Maxim Geraskyn
Guest
Posts: n/a
 
      02-08-2005
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


 
Reply With Quote
 
 
 
 
Andrea Desole
Guest
Posts: n/a
 
      02-08-2005
Maxim Geraskyn wrote:
> 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/s...doc.html#44994
 
Reply With Quote
 
 
 
 
Maxim Geraskyn
Guest
Posts: n/a
 
      02-08-2005
Andrea

> check out the specs:


Many, many, many thanks !
How could I miss it !

Maxim


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Classes within classes David ASP .Net 2 07-22-2005 07:13 PM
What is the difference between nested classes and inner classes ? Razvan Java 5 07-27-2004 07:59 PM
Modifiers applied to attributes, local variables, member functions, classes and inncer classes ! Razvan Java 11 07-17-2004 08:57 PM
Can I using reflection to get all child classes or classes undera package dynamically? Carfield Yim Java 1 05-31-2004 05:33 PM
How to access inner classes variables & methods from outer classes lonelyplanet999 Java 1 11-13-2003 01:54 PM



Advertisments