fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. List<String> list = new ArrayList<String>();
  13. list.add("video_codigo_1");
  14. list.add("video_codigo_2");
  15. list.add("video_codigo_3");
  16. list.add("video_codigo_4");
  17.  
  18. StringBuilder strB = new StringBuilder();
  19. for(int i =0; i < list.size(); i++){
  20.  
  21. if(i<(list.size()-1))
  22. strB.append(list.get(i)).append(",");
  23. else strB.append(list.get(i));
  24. }
  25. String url = "https://w...content-available-to-author-only...s.com/youtube/v3/videos?part=snippet,statistics&id="+strB.toString()+"&key={API_KEY}";
  26. System.out.println(url);
  27. }
  28. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
https://w...content-available-to-author-only...s.com/youtube/v3/videos?part=snippet,statistics&id=video_codigo_1,video_codigo_2,video_codigo_3,video_codigo_4&key={API_KEY}