I have an object that looks like this:
[
{
"title": "Job Title",
"email": "[email protected]",
"department": "Department",
"id": 123456789,
"name": "First Last"
}
]
How do I loop through this object and save the value of email in a variable?
Here is my code:
List<T> results = type.getResults();
String userEmail = "";
for (int i = 0; i < results.size(); i++) {
if (results.get(i).equals("email")) {
System.out.println("&&&&&&&&&&& in IF condition &&&&&&&&&&&&&&");
}
System.out.println(results.get(i));
}
But I just can't seem to get this loop to work.