![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
DoubleStream boxed() method in Java
The boxed() method of the DoubleStream class returns a Stream consisting of the elements of this stream, boxed to Double.
The syntax is as follows
Stream<Double> boxed()
Here, Double is the class that wraps a value of the primitive type double in an object. To work with DoubleStream class in Java, import the following page
import java.util.stream.DoubleStream;
The following is an example to implement DoubleStream boxed() method in Java
Example
import java.util.*; import java.util.stream.Stream; import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(80.2, 84.6, 88.9, 92.9); Stream<Double> s = doubleStream.boxed(); s.forEach(System.out::println); } }
Output
80.2 84.6 88.9 92.9
Advertisements