At last a thread I know something about!
Andreas is right. Java's generics were designed to be backward-compatible at
runtime. At compile time, using generics in a non-generic way will issue
compiler warnings that can be ignored.
-- Phil Heller
Author: Ground-Up Java, Complete Java 2 Certification Study Guide
-------------- Original message --------------
From: Andreas Prlic <[EMAIL PROTECTED]>
>
> >> These are good points. Can we generify interfaces without
> >> breaking them?
>
>
>
> I don;t think that adding generics will break anything, e.g.
>
> old code:
>
> public interface MyTest {
> public Set getFeatures()
> }
>
> then some code that uses this:
>
> public void myFoo(){
>
> MyTest test = new MyTestImpl();
>
> Set features = test.getFeatures();
> }
>
> this call will not break, even if we change the MyTest interface to:
>
> public Set getFeatures()
>
> MyTestImpl will get some warnings (in my eclipse), to ensure the type
> safety, but that is all.
>
> Andreas
>
>
>
>
>
> -----------------------------------------------------------------------
>
> Andreas Prlic Wellcome Trust Sanger Institute
> Hinxton, Cambridge CB10 1SA, UK
> +44 (0) 1223 49 6891
>
> -----------------------------------------------------------------------
>
>
>
>
> --
> The Wellcome Trust Sanger Institute is operated by Genome Research
> Limited, a charity registered in England with number 1021457 and a
> company registered in England with number 2742969, whose registered
> office is 215 Euston Road, London, NW1 2BE.
> _______________________________________________
> Biojava-l mailing list - [email protected]
> http://lists.open-bio.org/mailman/listinfo/biojava-l
_______________________________________________
Biojava-l mailing list - [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l