

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Boxed Array to Stream in Java
A boxed array is an array which is defined in the form of an object, instead of the primitives.
Example
Following is the program to convert Boxed Array to Stream in Java −
import java.util.*; import java.util.stream.*; public class Demo { public static void main(String args[]) { String arr[] = { "Laptop", "Mobile", "Notebook", "Desktop" }; System.out.println("Array = "+ Arrays.toString(arr)); Stream<String>s = Stream.of(arr); System.out.println("Stream (array to stream) = "+ Arrays.toString(s.toArray())); } }
Output
Array = [Laptop, Mobile, Notebook, Desktop] Stream (array to stream) = [Laptop, Mobile, Notebook, Desktop]
- Related Questions & Answers
- Java Program to convert Stream to typed array
- Program to convert Primitive Array to Stream in Java
- Program to convert Stream to an Array in Java
- Java Program to convert Stream to List
- Program to convert List to Stream in Java
- Program to convert a Map to a Stream in Java
- Convert Stream to Set in Java
- How to Convert a Java 8 Stream to an Array?
- How to convert an input stream to byte array in java?
- Array To Stream in Java
- Program to convert a Set to Stream in Java using Generics
- Convert an Iterator to Stream in Java
- Convert an Iterable to Stream in Java
- How to convert Stream to TreeSet in Java?
- Java Program to create Stream from a String/Byte Array
Advertisements