DEV Community

devanshi2806
devanshi2806

Posted on

1

Java - ArrayList object looping through multiple values and keys

I'm new to Java and I'm making Following json by using a single arraylist with for loop and if statement.I want to use dynamic forloop.But I'm stuck with my for loop logic part.

Here is my java program.

main.java

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

public class

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post