Aishwarya Naglot has Published 180 Articles

How can we read & write a file using Gson streaming API in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 13:06:24

1K+ Views

We can read and write a file using Gson streaming API, and it is based on the sequential read and write standard. The JsonWriter and JsonReader are the core classes built for streaming write and read in Streaming API. Reading & Writing a File using Gson Streaming API The JsonWriter ... Read More

Convert an Iterator to a List in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 13:02:25

587 Views

An Iterator is used for cycling through a Collection of objects. Whereas a List is an Interface which is used for storing an ordered collection of elements. Both classes are part of the Java Collections Framework.Converting an Iterator to a List in Java  Sometimes we need to convert an Iterator to a ... Read More

Convert an Iterable to Stream in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:56:05

310 Views

What is an Iterable?Iterable is an Interface that is used for iterating over a Collection of objects. It is part of the Java Collections Framework. The Iterable interface is implemented by all the collection classes in Java. For example, ArrayList, HashSet, etc. The Iterable interface has a method named iterator() ... Read More

Convert an Iterable to Collection in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:53:31

329 Views

In Java, we can store objects within other objects. A collection is an object that stores other objects. Some examples of collections are ArrayList, HashSet. Iterable is an Interface that is used for iterating over a Collection of objects. It is part of the Java Collections Framework. The Iterable interface is ... Read More

Convert a String to a List of Characters in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:41:14

1K+ Views

In this article, we will learn how to convert a string to a list of characters in Java. Sometimes, when we handle character-based data structures, we need to convert a string into a list of characters. In Java, a string is a sequence of characters and is represented by the ... Read More

Try, catch, throw and throws in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:36:18

2K+ Views

Try-catch, throw, and throws are keywords that are used for handling exceptions in Java. Exceptions are the problems that occur during the execution of a program. When a problem occurs, the program you are trying to run will terminate abnormally. So, to handle these exceptions, Java has a mechanism called ... Read More

Pretty print JSON using Jackson library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:30:00

2K+ Views

A Jackson API is a Java-based library, and it can be useful to convert Java objects to JSON and JSON to Java objects. A Jackson API is faster than other API, needs less memory, and is good for large objects. We can process a JSON in three different ways: Streaming ... Read More

Convert JSON to/from Map using Jackson library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:24:44

2K+ Views

JSON is a format that is used to exchange data between a server and a client. It is lightweight and easy to read and write. In Java, we can convert JSON to/from Map using various libraries. In this article, we will discuss how to convert JSON to/from Map using the ... Read More

How to format a date using the Gson library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 12:22:07

7K+ Views

Gson is a JSON for Java, which is developed by Google. We can format a date using the Gson library in Java. The Gson library provides a GsonBuilder class that allows us to create a Gson instance with custom settings. We call the create() method of the GsonBuilder class to ... Read More

Pretty print JSON using org.json library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 12-May-2025 11:06:55

11K+ Views

Pretty Printing JSON using "org.json" Library Pretty printing something means formatting it in a way that is easy to read, understand, and also looks good. Here we will format JSON data in a good-looking as well as readable way. We will be using the org.json library to pretty print JSON ... Read More

Advertisements