Hi,
I just created a class service.java. It is as follows
import org.json.simple.JSONObject;
public class service {
JSONObject obj=new JSONObject(); //line 1
obj.put("name","foo"); //line 2
obj.put("num",new Integer(100)); //line 3
obj.put("balance",new Double(1000.21)); //line 4
obj.put("is_vip",new Boolean(true)); //line 5
obj.put("nickname",null); //line 6
out.print(obj); //line 7
out.flush(); //line 8
}
I am getting a compilation error stating
"Syntax error on token(s), misplaced construct(s)" on line 1,
"Syntax error on tokens, delete these tokens" on line 1,
"Syntax error on token "flush", Identifier expected after this token" on line 8,
"Syntax error on token "obj", VariableDeclaratorId expected after this token" on line 7,
"Syntax error on tokens, AnnotationName expected instead" on line 3.
"Syntax error, insert "Type VariableDeclaratorId" to complete FormalParameterList" on line 3.
Please help.
Regards,
Anas