I am getting the error:
Unchecked call to 'put(K, V)' as a member of raw type 'java.util.HashMap'
This is the line that shows the error:
JSONArray FieldValues = new JSONArray(new JSONObject(new HashMap().put(K, V)));
Am I doing anything wrong or is there something I should add? any help is greatly appreciated
Looks like you are missing the types.
Something like
new HashMap<Type1,Type2>().put(K,V)
should work.
For anonymous use:
new HashMap<Type1,Type2>().put(K,V);
For initializing a variable:
HashMap<Type1,Type2> hashMap = new HashMap<>();
hashMap.put(K,V);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With