I have some data stored in Java elements and I need to return it in a given format - JSONObject. While my implementation works fine, I\'m still getting a warning message fro
What is your JSONObject, does it inherit from HashMap? If does, the warn probably means that your should declare the JSONObject instance as follows:
JSONObject obj=new JSONObject();
Updated: Look at the definition of the JSONObject:
public class JSONObject extends HashMap
it extends HashMap but doesn't support parameter type, if its definition is
public class JSONObject extends HashMap
then we could write
JSONObject obj=new JSONObject();
and the put method will no longer generate the warning