I am really new to Java world. Just joined the forum 2 min back.
Basically I come form Mac iOS development expanding my skill sets to Java/Android domain also.
I dont know whether this is the correct place in the forum to post my question or not let me try mine.
I am writing a JSON service that will parse JSON and return me a JSON object or an array whatever possible.
Can any one guide me to the correct way to it?
I did some R&D making it up to a successful call to Network as..................
Can you look at if error handling and garbage collection ( in method finalize () & clearGarbage() ) is alright?
You need not worry about garbage collection, but yes you should close all the resources which you open like FileReaders, network connections and so on. And dont rely on finalizers to do your garbage collection activity.
Then in your code you are not doing anything JSONish, I just see you are obtaining some data from a URL. For reading JSON or creating JSON have a look at GSON library. You would have to download the JAR and then add it to your classpath and use the APIs therein to parse/create JSON.
It was really appreciable that you come across to solve my problem .
I will try your solution and revert.
Mohamed Sanaulla wrote: For reading JSON or creating JSON have a look at GSON library. You would have to download the JAR and then add it to your classpath and use the APIs therein to parse/create JSON.