Buy Questpond's video subscriptions on
huge discount
.
Online: 1461
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
>
Others
>
Loading ...
Consider the below
List<String> lstNames = new ArrayList<String>();
lstNames.add("Name1");
lstNames.add("Name2");
lstNames.add("Name3");
lstNames.add("Name4");
lstNames.add("Name5");
Stream<String> stream = lstNamesstream();
Which method in Java 1.8 will help to convert a Stream to Collection?
Posted by
Rajnilari2015
on 9/19/2015 | Category:
Others Interview questions
| Views: 2763 |
Points: 40
Post
|
Interview FAQs
|
Exclusive Questions
|
Interview Home
Select from following answers:
stream.toList()
stream.getCollection()
stream.Collectors.toList()
stream.collect(Collectors.toList())
All Above
The collect method converts a Stream to the Collection specified. It is under the package
java.util.stream.Collectors
More about Java1.8 stream
https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html
Show Correct Answer
Asked In:
Many Interviews |
Alert Moderator
Bookmark It
< Previous :
How SQL Server 2008's Hierarchyid performs the ...
Next > :
Consider the below List<String> lstNames ...
Comments or Responses
Login to post response
More Interview Questions by Rajnilari2015
Consider the below List<String> lstNames = new ArrayList<S ...
Which among the below HTTP verbs will allow to remove the content of a ...
Which among the below HTTP verbs will allow to modify the content of a ...
Which among the below HTTP verbs will allow to create a new content of ...
How to resolve the Cross Origin Resource Sharing (CORS) issue in Asp.n ...
How a secure WebSocket URL begins with?
Can u please explain with a very basic example as how cilent-server co ...
We need to call the open method by creating a WebSocket object inorder ...
Latest Interview Questions
Testing done by developer on parts of source code is called?
The testing performed on the source code by developer is called?
In page life cycle in which event the final changes to viewstate and c ...
In c# multiple inheritance is achieved by which of the following?
Default session mode in web.config file?
Which commands among the following execute faster?
How is model binding in MVC different from ViewState in ASP.net Webfor ...
How do you use Glyphicons?
More ...