- 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 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 Articles
- 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
- Program to convert List to Stream in Java
- Java Program to convert Stream to List
- Program to convert a Map to a Stream in Java
- How to convert an input stream to byte array in java?
- How to Convert a Java 8 Stream to an Array?
- Program to convert a Set to Stream in Java using Generics
- Convert Stream to Set in Java
- Array To Stream in Java
- How to convert Stream to TreeSet in Java?
- Convert an Iterator to Stream in Java
- Convert an Iterable to Stream in Java
- Program to convert Array to List in Java

Advertisements