I searched for quite a while, and nothing really comes close to what I need.
Code example:
public class MyQueue<E extends Delayed & Serializable> extends DelayQueue<E> {
private Class<E> mClass;
public MyQueue(Class<E> type) {
super();
mClass = type;
}
}
MyQueue created as: MyQueue q<MyObj> = new MyQueue<MyObj>(MyObj.class);.
My question is: how can I write a constructor in such a way that the "type" parameter has the correct parameterized type "E extends Delayed and Serializable"?
Hope I fully explained.
Thanks in advance for any help.
Change . From the answers and comments, at first I could not choose the correct answer. Therefore, for the first time, I will try to strengthen my question with what I wanted in the first place and what I have done now. For example, replying to the original message that I found.
, , E . E ( MyObj) . , - . , -.
, (MyObj OthrObj Delayed Serializable):
MyQueue q<MyObj> = new MyQueue<MyObj>(OthrObj.Class);
: , E E?
, , , , . , , , , , , .