Skip to content
Advertisement

How to convert list data into json in java

I have a function which is returning Data as List in java class. Now as per my need, I have to convert it into Json Format.

Below is my function code snippet:

JavaScript

I tried To convert into json by using this code but it is giving type mismatch error as function is of type List…

JavaScript

Please help me resolve this.

Advertisement

Answer

JavaScript

you can get the data in the following form

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement