'How to access nested data in java from json? (Working Python version but need a java version)

How to access answer of specific question_id (32932554) of each attendee in java:

The working python version:

        for attendee in json_string['attendees']:
        for section in attendee["answers"]:
            question = section["question_id"];
            if question == "32932554":
                answer = section["answer"].strip();

How would I do this in Java as the data is coming from an api which returns a json file but I can't filter the file I just get the whole json back?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source