I need to loop through a bunch of JSON snippets in Java and extract two pieces of data from each. For example:
"id":8041841931,"title":"Black","option1":"Black","option2":null,"option3":null,"price":"83.79","grams":4706,"compare_at_price":null,"sku":"","requires_shipping":true,"taxable":true,"position":3,"product_id":2759169283,"created_at":"2015-09-23T20:51:28-04:00","updated_at":"2015-09-23T20:51:28-04:00","available":true,"featured_image":null},
I need keep track of the "price" and "grams" of each of these snippets then eventually sort them in ascending order by grams. These snippets are all in an array of String[]. What would be the best way to go about doing this?