How to minify and pretty print JSON in JavaScript

7 years ago Lalit Bhagtani 0
How to minify and pretty print JSON in JavaScript :-  In this tutorial, we will learn how to minify and pretty print JSON in JavaScript. Java Script provide us a method JSON.stringify(), which can convert Java Script value or object to JSON string. Method :-    JSON.stringify ( value])  This method takes three Read More

JavaScript – How to parse JSON in javascript

7 years ago Lalit Bhagtani 0
How to parse JSON in JavaScript :-  If you had worked on angularJS or any other modern java script framework, then you would have noticed that, now days restful web services are used to communicate ( Getting data or Posting data ) with the server. In restful web services, JSON format is used ( mostly Read More

Download file from Internet in Java using apache commons-io

7 years ago Lalit Bhagtani 0
Download file from Internet in Java :- In this tutorial, we will learn to download file from Internet in java using apache’s commons-io library. Let’s see an implementation using commons-io library with the help of an example :- Apache Commons-IO :-  In case of commons-io library, we will call copyURLToFile() method of FileUtils class by passing URL Read More

Download file from URL in Java using java.io & java.nio

7 years ago Lalit Bhagtani 1
Download file from URL in Java :- In this tutorial, we will learn to download file from URL in java. There are two different API’s in Java, which can be used for this purpose, java.io & java.nio. Let’s see an implementation using both API’s with the help of an example  :- Java IO :-  In Read More

Java 8 Stream peek method Example

7 years ago Lalit Bhagtani 0
In this tutorial, we will learn about Java 8 stream peek method. peek() method :- This method takes one Consumer as an argument, this consumer accepts one parameter T as an input argument and return one stream of parameter T as a return value. The main purpose of this method is to support debugging, When you want to see Read More

Convert XMLGregorianCalendar to Date Object

7 years ago Lalit Bhagtani 0
XMLGregorianCalendar to Date Object :- In this tutorial, we will learn to convert XMLGregorianCalendar to Date Object. If you had worked on a project which consume or publish SOAP web services, then you would had faced a problem in converting XMLGregorianCalendar to Date Object and vice versa. Let’s see an implementation with the help of Read More

Convert Date to XMLGregorianCalendar Object

7 years ago Lalit Bhagtani 0
Date to XMLGregorianCalendar Object :- In this tutorial, we will learn to convert Date to XMLGregorianCalendar Object. If you had worked on consuming or publishing SOAP web services, then you would had faced the problem in converting Date to XMLGregorianCalendar Object and vice versa. Let’s see an implementation with the help of an example  :- Example Read More

Java 8 Stream flatMap method Example

7 years ago Lalit Bhagtani 5
In this tutorial, we will learn about Java 8 stream flatMap method. flatMap() method :- This method takes one Function as an argument, this function accepts one parameter T as an input argument and return one stream of parameter R as a return value. When this function is applied on each element of this stream, it produces a Read More

Java 8 Stream map method Example

7 years ago Lalit Bhagtani 0
In this tutorial, we will learn about Java 8 stream map method. map() method :- This method takes one Function as an argument and returns a new stream consisting of the results generated by applying the passed function to all the elements of the stream. Syntax :-  <R> Stream<R> map ( Function<? super T, ? extends R> Read More

Java 8 Stream limit & skip method Example

7 years ago Lalit Bhagtani 0
In this tutorial, we will learn about Java 8 stream limit and skip method. limit() method :- This method takes one long ( N ) as an argument and return a stream of length N, after truncating it. Syntax :-  Stream<T> limit(long n) Reference :-  limit() method JavaDocs Problem Statement :- You have given a list of integers, remove all Read More