Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. primitive

Tag: primitive

java November 18, 2016 2 min read by mkyong 3 comments

Java – How to convert a primitive Array to List

Code snippets to convert a primitive array int[] to a List<Integer> : int[] number = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; List<Integer> list = new ArrayList<>(); for (int i : number) { list.add(i); } In Java 8, you can use the Stream APIs to do the boxing and conversion like this […]

Read more Java – How to convert a primitive Array to List

Recent Posts

  • Java Compact Source File: No Class, No Static Main
  • Java Scoped Values Example
  • Spring Boot RAG Example with Spring AI
  • Java AtomicInteger Example
  • Java Virtual Threads Example
  • Spring Boot Supabase CRUD Example
  • Spring Boot REST Docs Example
  • How to Install Java on Windows (Step-by-Step Guide)

© 2008–2026 mkyong.com

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use