- 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
Convert IntStream to String in Java
If you have IntStream with ASCII values, then easily convert it to string using the below given example.
For IntStream class, import the following package
import java.util.stream.IntStream;
Let’s say the following is our IntStream
IntStream stream = "Example".chars();
Now, convert the IntStream to string
String str = stream.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString();
The following is an example to convert IntStream to String in Java
Example
import java.util.stream.IntStream; class Demo { public static void main(String[] args) { IntStream stream = "Example".chars(); System.out.println("The ASCII values..."); String str = stream.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); System.out.println("The converted string = " + str); } }
Output
The ASCII values... The converted string = Example
- Related Articles
- Convert String to IntStream in Java
- Program to convert IntStream to String in Java
- Program to convert String to IntStream in Java
- Convert Character Array to IntStream in Java
- Java Program to convert int array to IntStream
- Convert Java String to Short in Java
- Convert String to Long in Java
- Convert byte to String in Java
- Convert int to String in Java
- Convert double to string in Java
- Convert short to String in Java
- Convert String to Date in Java
- Convert String to Double in Java
- Convert String to Java int
- Convert string to a number in Java

Advertisements