I'm learning to Decode JSON files in Java and have come across some Syntax I do not understand. I am also new to Java. Here is the code snippet:
Object obj = JSONValue.parse(jsonResult);
JSONArray array = (JSONArray)obj;
In my best attempt at Programmer speak, I understand that "JSONArray" is a class. We are instantiating a new JSONArray and calling it "array". We are initializing "array" with the value on the right side of the equal sign.
My question is -- I don't understand what is happening on the right side of the equal sign. Why is "JSONArray" in parenthesis: (JSONArray)obj? I don't understand what is happening here.
Thanks!