![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
AmitDiwan has Published 11365 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
329 Views
Let’s say the following is our Iterator with Integer values −Iterator iterator = Arrays.asList(50, 100, 200, 300, 400, 500, 1000).iterator();Now, convert this Iterator to a List −List myList = new ArrayList(); iterator.forEachRemaining(myList::add);ExampleFollowing is the program to convert an Iterator to a List in Java − Live Demoimport java.util.*; public class Demo ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
178 Views
Let’s say the following is our Iterable −Iterable i = Arrays.asList("K", "L", "M", "N", "O", "P");Now, create a Collection −Stream s = convertIterable(i);Above, we have a custom method convertIterable() for conversion. Following is the method −public static Stream convertIterable(Iterable iterable) { return StreamSupport.stream(iterable.spliterator(), false); }ExampleFollowing is the program ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
183 Views
Let’s say the following is our Iterable −Iterable i = Arrays.asList(50, 100, 150, 200, 250, 300, 500, 800, 1000);Now, create a Collection −Collection c = convertIterable(i);Above, we have a custom method convertIterable() for conversion. Following is the method −public static Collection convertIterable(Iterable iterable) { if (iterable instanceof List) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
302 Views
Let’s say the following is our string −String str = "55.2";Now, convert the above string to double using parseDouble() in Java −double res = Double.parseDouble("23.6");ExampleFollowing is the program to convert String to Double in Java − Live Demopublic class Demo { public static void main(String args[]){ String ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
491 Views
Let’s say the following are our strings −String date1 ="11/10/2018"; String date2 = "15-Mar-2019 21:11:35";Now, convert the above string to dates −SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); Date formattedDate1 = dateFormat1.parse(date1); Date formattedDate2 = dateFormat2.parse(date2);ExampleFollowing is the program to convert String to Date in Java ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
822 Views
Let’s say the following is our string −String str = "Website!";Now, convert the above string to a list of characters −Listlist = str.chars().mapToObj(n -> (char)n).collect(Collectors.toList());ExampleFollowing is the program to convert a string to a list of characters in Java − Live Demoimport java.util.*; import java.util.stream.Collectors; public class Demo { public ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
2K+ Views
Try and catch in JavaA method catches an exception using a combination of the try and catch keywords. A try/catch block is placed around the code that might generate an exception.Following is the syntax for try and catch −try { // Protected code } catch (ExceptionName e1) { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
43 Views
The HTML KeyboardEvent which property returns the Unicode character code of the key that fires the onkeypress event, onkeydown event or onkeyup event in an HTML document.SyntaxFollowing is the syntax −event.whichLet us see an example of HTML KeyboardEvent which property −Example Live Demo body { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
95 Views
The HTML navigator javaEnabled() method returns a boolean value that defines whether the browser has java enable or not.SyntaxFollowing is the syntax −navigator.javaEnabled()Let us see an example of HTML navigator userAgent property −Example Live Demo body { color: #000; height: 100vh; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
141 Views
The HTML navigator userAgent property returns the value of the user-agent header sent by the browser to the server.SyntaxFollowing is the syntax −navigator.userAgentLet us see an example of HTML navigator userAgent property −Example Live Demo body { color: #000; height: 100vh; ... Read More