- 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 skip() method in Java
The skip() method of the DoubleStream class in Java returns a stream consisting of the remaining elements of this stream after discarding the first numEle elements of the stream. The numEle is a parameter which you can set to skip any number of elements from the stream.
The syntax is as follows −
DoubleStream skip(long numEle)
Here, numEle is the number of elements to skip. The leading elements are skipped.
To use the DoubleStream class in Java, import the following package −
import java.util.stream.DoubleStream;
The following is an example to implement DoubleStream skip() method in Java −
Example
import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(39.8, 78.7, 64.7, 35.7, 47.8, 89.7, 28.7); System.out.println("Remaining Elements..."); doubleStream.skip(5).forEach(System.out::println); } }
Output
Remaining Elements... 89.7 28.7
Advertisements