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

5
LINES

< > BotCompany Repo | #1023695 // addAndPrint - add element to a collection, print the element and return it

JavaX fragment (include)

static <B, A extends B> A addAndPrint(Collection<B> c, A a) {
  print(a);
  if (c != null) c.add(a);
  ret a;
}

Author comment

Began life as a copy of #1007299

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023695
Snippet name: addAndPrint - add element to a collection, print the element and return it
Eternal ID of this version: #1023695/1
Text MD5: 54f5fb39e32f8d3489aa3bbcef2cbdb7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-03 13:16:35
Source code size: 115 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 311 / 334
Referenced in: [show references]