开发者

Interface declaration to handle primitive types

I have an interface that declares set() method.

One implementing class operates on byte[] arrays, therefore it will implement set(byte[] arr) Another class operates on int[] arrays, therefore it will implement set(int [] arr).

Since int & byte are primitive types, I'm 开发者_开发技巧not sure how to write the interface declaration!

Any ideas? Thanks.


interface Name<T> {
  void set(T object);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜