S
Stefan Ram
How can I modify the end of line 6 to make the declaration of
the class »Value1« being compiled (similar to the declaration of
the class »Value0«, which is being compiled)?
interface Value<T> { public void operation(final T t); }
class Value0<T> implements Value<T[]>
{ public void operation( final T[] t ){}; }
class Value1<T> implements Value<T...>
{ public void operation( final T... t ){}; }
/* Main.java:6: > expected
class Value1<T> implements Value<T...>
1 error ^ */
~~
Ok, the following class declaration now can be compiled:
class Value1<T> implements Value<T[]>
{ public void operation( final T... t ){}; }
But I still get a warning:
Main.java:6: warning: operation(T...) in Value1 implements operation(T) in Value; overridden method has no '...'
{ public void operation( final T... t ){}; }
^
1 warning
Is there a way to write this in such a way that there will
not even be a warning message, retaining the declaration
»public void operation( final T... t ){};«?
the class »Value1« being compiled (similar to the declaration of
the class »Value0«, which is being compiled)?
interface Value<T> { public void operation(final T t); }
class Value0<T> implements Value<T[]>
{ public void operation( final T[] t ){}; }
class Value1<T> implements Value<T...>
{ public void operation( final T... t ){}; }
/* Main.java:6: > expected
class Value1<T> implements Value<T...>
1 error ^ */
~~
Ok, the following class declaration now can be compiled:
class Value1<T> implements Value<T[]>
{ public void operation( final T... t ){}; }
But I still get a warning:
Main.java:6: warning: operation(T...) in Value1 implements operation(T) in Value; overridden method has no '...'
{ public void operation( final T... t ){}; }
^
1 warning
Is there a way to write this in such a way that there will
not even be a warning message, retaining the declaration
»public void operation( final T... t ){};«?