How Memory Allocated Static non-static and Static Block in Java
smoke-stack or heap? category A{ stationary int a; static{}public
stationary vacant main(String args[]){A h=new A();} }When emanate a
vigilant how memory allocated for stationary smoke-stack or heap.
Tuesday, 8 April 2014
Friday, 4 April 2014
Not means to parse JSON array string
I am operative on digest in that we am eventuality ask ot server for
removing JSON array string. we am controlling following java formula
to emanate one JSON array list string. JSONArray itemList = new
JSONArray(); for(int i =0; i<4; i++) { String
exe = "m"; final JSONObject jsonObj = new JSONObject();
jsonObj.put("filePath", 30);
jsonObj.put("duration", 12222); jsonObj.put("bitRate",
1111); jsonObj.put("widht", 12);
jsonObj.put("format", 123); jsonObj.put("height", 12);
jsonObj.put("exe", exe); JSONObject jObject = new
JSONObject(); try {
itemList.put(jsonObj); // jObject.put("itemList",
itemList); } locate (Exception e) {
System.out.println("ERROR"); } }
relapse itemList.toString();}On fan side,in AJAX response, we am removing
following String by controlling above
method:[{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}]When
we am controlling JQuery to parse it as follows:
$jQ.each($jQ.parseJSON(responseJSON), function(idx, obj) {
alert(obj.filePath); });I am removing JS blunder as
"JSON.parse: approaching ability name or '}'"I am not removing since this
blunder is occuring.
removing JSON array string. we am controlling following java formula
to emanate one JSON array list string. JSONArray itemList = new
JSONArray(); for(int i =0; i<4; i++) { String
exe = "m"; final JSONObject jsonObj = new JSONObject();
jsonObj.put("filePath", 30);
jsonObj.put("duration", 12222); jsonObj.put("bitRate",
1111); jsonObj.put("widht", 12);
jsonObj.put("format", 123); jsonObj.put("height", 12);
jsonObj.put("exe", exe); JSONObject jObject = new
JSONObject(); try {
itemList.put(jsonObj); // jObject.put("itemList",
itemList); } locate (Exception e) {
System.out.println("ERROR"); } }
relapse itemList.toString();}On fan side,in AJAX response, we am removing
following String by controlling above
method:[{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}‚{"duration":12222‚"height":12‚"widht":12‚"filePath":30‚"format":123‚"bitRate":1111‚"exe":"m"}]When
we am controlling JQuery to parse it as follows:
$jQ.each($jQ.parseJSON(responseJSON), function(idx, obj) {
alert(obj.filePath); });I am removing JS blunder as
"JSON.parse: approaching ability name or '}'"I am not removing since this
blunder is occuring.
Subscribe to:
Comments (Atom)