Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1004236 // newList - always returns a new ArrayList (no wrapping)

JavaX fragment (include)

1  
static <A> ArrayList<A> newList(A[] a) {
2  
  ret asList(a);
3  
}
4  
5  
static ArrayList<Integer> newList(int[] a) {
6  
  ret asList(a);
7  
}
8  
9  
static <A> ArrayList<A> newList(Collection<A> s) {
10  
  ret asList(s);
11  
}

Author comment

Began life as a copy of #1000999

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004236
Snippet name: newList - always returns a new ArrayList (no wrapping)
Eternal ID of this version: #1004236/1
Text MD5: 2083615850fb3488eb0d632094fa16ca
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-10 19:32:24
Source code size: 205 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 476 / 478
Referenced in: [show references]