java - Want to run an Object Array into a Generic Constructor -
class circulararraydeque<e> implements deque { private e[] items; private int currentsize, capacity, front, back; private static final int default_capacity = 10; public circulararraydeque(collection<? extends e> other) { items = (e[]) other.toarray(); currentsize = other.size(); front end = 0; = currentsize - 1; } } public static void main(string[] args) { int[] arr = {8, 7, 5, 3, 6, 7, 12, 4}; }
i want able run arr constructor circulararraydeque(arr). deque interface wrote up, it's not 1 of java's class. i'm not sure how can if possible. or alter arr object integer like.....
integer[] arr = {8, 7, 5, 3, 6, 7, 12, 4};
try this:
final collection<integer> coll = arrays.aslist(8, 7, 5, 3, 6, 7, 12, 4);
java object constructor
No comments:
Post a Comment