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

11
LINES

< > BotCompany Repo | #1004057 // arrayrep - repeat elements as an array

JavaX fragment (include)

static O[] arrayrep(O a, int n) {
  O[] array = new[n];
  for i to n: array[i] = a;
  ret array;
}

static <A> A[] nuLike arrayrep(Class<A> type, A a, int n) {
  A[] array = newArray(type, n);
  for i to n: array[i] = a;
  ret array;
}

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: #1004057
Snippet name: arrayrep - repeat elements as an array
Eternal ID of this version: #1004057/2
Text MD5: c88cbb934e107dfe4e3f364065628f5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-29 20:12:29
Source code size: 245 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 517 / 552
Version history: 1 change(s)
Referenced in: [show references]