- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Program to convert List of Integer to List of String in Java
Here’s our List of Integer −
List<Integer> listInteger = Arrays.asList(25, 50, 75, 100, 125, 150);
Now, convert List of Integer to List of String −
List<String> listString = listInteger.stream() .map(s -> String.valueOf(s)) .collect(Collectors.toList());
Following is the program to convert List of Integer to List of String in Java −
Example
import java.util.*; import java.util.stream.*; import java.util.function.*; public class Demo { public static void main(String[] args) { List<Integer> listInteger = Arrays.asList(25, 50, 75, 100, 125, 150); System.out.println("List of Integer = " + listInteger); List<String> listString = listInteger.stream() .map(s -> String.valueOf(s)) .collect(Collectors.toList()); System.out.println("List of String (converted from List of Integer) = " + listString); } }
Output
List of Integer = [25, 50, 75, 100, 125, 150] List of String (converted from List of Integer) = [25, 50, 75, 100, 125, 150]
- Related Articles
- Program to convert List of String to List of Integer in Java
- Convert list of string into sorted list of integer in Python
- Java Program to Convert a List of String to Comma Separated String
- Convert list of string to list of list in Python
- Convert List of Characters to String in Java
- Python - Convert list of string to list of list
- How to convert Integer array list to integer array in Java?
- Java program to convert a list of characters into a string
- Program to convert Set of Integer to Set of String in Java
- Program to convert set of String to set of Integer in Java
- Convert a String to a List of Characters in Java
- Convert list of numerical string to list of Integers in Python
- Java Program to convert from integer to String
- Java Program to convert from String to integer
- Convert a List of String to a comma separated String in Java

Advertisements