Aishwarya Naglot has Published 180 Articles

Convert List of Characters to String in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 06-May-2025 16:36:36

942 Views

In this article, we will learn to convert a list of characters to strings in Java. Sometimes, when we handle character-based data structures, we need to convert a list of characters into a string. Problem Statement Given a list of characters, the task is to convert it into a single string ... Read More

How can we merge two JSON arrays in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 18:35:33

8K+ Views

In this article, we will be learning how to merge two JSON arrays in Java. Let's understand step by step. First, if you are not familiar with JSON, refer JSON overview. How to Merge Two JSON Arrays in Java? There are multiple ways to merge two JSON arrays in Java. ... Read More

How to get all the keys of a JSON object using GSON in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 18:31:43

4K+ Views

JSON is the data interchange format that stores values in key-value pairs. (To learn more about JSON, you can refer to the JSON tutorial). So, as we have key and value in JSON, we will try to get all those keys using the Gson library. Gson Library: Retrieving all the keys ... Read More

How can we parse a nested JSON object in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 16:28:52

15K+ Views

Sometimes, we need to parse a nested JSON object, which means an object inside another object. In this article, let's learn about how to parse a nested JSON object in Java. If you don't know about JSON, refer JSON overview. Parsing a Nested JSON Object in Java? We can ... Read More

How can we sort a JSONArray in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 16:27:02

9K+ Views

In this article, we will learn how to sort a JSON array in Java. But first, let’s understand what JSON is. If you do not have knowledge about JSON, you can refer to the tutorial JSON Overview. Now, let's see different ways to sort a JSON array in Java. Ways ... Read More

How to get the values of the different types from a JSON object in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 16:05:02

31K+ Views

We often need to extract values from a JSON object. In this article, we will learn how to get the values of the different types from a JSON object in Java. What is JSONObject? Java JSONObject is a class in the org.json package that represents a JSON object. Refer JSONObject ... Read More

Convert a list of objects to JSON using the Gson library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 15:58:08

8K+ Views

In this article, we will be discussing how to convert a list of objects to JSON using the Gson library in Java. JSON is an interchangeable format that is used for data exchange. Values in JSON are represented as key-value pairs. To know more about JSON, refer JSON. Java GSON ... Read More

Convert a Map to JSON using the Gson library in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 15:54:04

4K+ Views

Converting a map to a JSON object is our task here. Let's see how to convert a map to a JSON object in Java using the Gson library. Converting a Map to JSON using the Gson library JSON is a simple and lightweight data interchange format. It stores data in ... Read More

How can we check if a JSON object is empty or not in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 15:38:38

11K+ Views

In this article, let's learn how to check if a JSON object has any values or not in Java. If you don't know about JSON, refer JSON. We will use the org.json library and its methods like isEmpty(), length(), and keys() to check if a JSON object is empty or ... Read More

How to convert a JSON array to CSV in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 22-Apr-2025 15:25:06

6K+ Views

JSON is a lightweight data interchange format. It is mostly used in web applications for sending and receiving data. To know more about JSON, refer JSON. A JSON array is a collection of JSON objects. It is similar to a list in Java. CSV is the format for storing tabular ... Read More

Advertisements