Well, I have an interface which is;
public interface abc {
public<T extends JPanel> T initalize();
}
And I'm implementing it. Here is thing, when I defining function like:
public class Startup_thePanel extends JPanel implements abc {
public Startup_thePanel initalize() {
return this;
}
}
I'm getting warning on function initalize which is 'Type safety: The expression of type ... needs unchecked conversion to conform to ...'.
I can get rid of this with using suppresswarning but I do not want to use it. What am I missing ?
Thanks in advance...
public interface abc<T extends JPanel> {
public T initalize();
}
public class Startup_thePanel extends JPanel implements abc<Startup_thePanel> {
public Startup_thePanel initalize() {
return this;
}
}
this would make the compiler to know which type of interface your are implementing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With