Q: Parse JSON File and iterate over specific parameters where I want to check which elements of the 1st file are missing in the second one. 
Here is the form of the first one: 
[
    {
        "pId": "pId1",
        "Platform":["ios","and","web","winph","win"],
        "Name": "ay",
        "ShortDescription": "Mobi",
        "Detail" : {
            "IncentiveInformation": "ppp",
            "DisplayName" : "vvv!",
            "Description" : "mmm",
            "TermsAndConditions": ".."
        }
    },
    {
        "pId": "pId2",
        "Platform":["afasd","sdfsd","pppp","asdas","win"],
        "Name": "ay",
        "ShortDescription": "mob",
        "PromotionDetail": {
            "DebugMode": false,
            "PromoDate": ["2015.01.01-00:01","2015.01.01-23:59"],
            "IncentiveInformation": "PRO",
            "Name": "iTunes",
            "ShortDescription": "Punkte sammeln bei iTunes",
            "DisplayName": null,
            "Description": null,
            "ImageURL": null,
            "JumpToShopURL": "urlHere",
            "JumpToShopName" : "Zu iTunes"
        }
    },
    {   
        "pId": "pId3",
        "Platform":["wqdsa"],
        "Name": "poti",
        "ShortDescription": "pun",
        "ImageURL": "url.here",
        "Promotion" : false,        
        "PromotionDetail": {
            "DebugMode": false,
            "PromoDate": ["2015.01.01-00:00","2015.01.01-23:59"],
            "IncentiveInformation": "ppeur",
            "Name": "namehere",
            "ShortDescription": "tune",
            "DisplayName": null,
            "Description": null,
            "ImageURL": null,
            "JumpToShopURL": "noq",
            "JumpToShopName" : "Zu"
        }
    }

]

and here is the form of the 2nd one:
    {
    "pList": [{
        "shortName": "bb",
        "longName": "bb",
        "pId": "pId2",
        "featured": true,
        "pLog": "url.here",
        "incentivation": "eu",
        "details": {
            "teaserImage": "image.url",
            "description": "desc here",
            "jumpToShopURL": "nurl",
            "jumpToShopButton": "zubay",
            "terms": [{
                "headline": "Wichtig",
                "body": "bodyline"
            }]
        }
    }, {
        "shortName": "one short name",
        "longName": "bkp",
        "pId": "pId1",
        "featured": true,
        "pLo": "some.pLo",
        "incentivation": "1p",
        "details": {
            "teaserImage": "some.url",
            "description": "desc",
            "jumpToShopURL": "short url",
            "jumpToShopButton": "Zuay",
            "terms": [{
                "headline": "Wichtig",
                "body": "bodyhere"
            }]
        }
    }]
}

Si I thought to save all the "pId" of the first one in a List(or array) and then iterate over that list and check for each one if the pId exists in the new one. 
So I tried this, but it is not working.. 
Could anyone help me with that? I tried a bit and then I found that I have too many difficulties, to get the pIds saved in a list or an array. 
So has someone an idea?
import java.io.*;
import org.json.*;

public class MainDriver {

    public static void main(String[] args) throws JSONException {


        String jsonData = readFile("C:\\Users\\kbelkhiria\\Desktop\\Karim_JSON\\alt.json");
        JSONObject jobj = new JSONObject(jsonData);
        JSONArray jarr = new JSONArray(jobj.getJSONArray("pList").toString());

        for(int i = 0; i < jarr.length(); i++) 
            System.out.println("id: " + jarr.getString(i)); 


    }

    public static String readFile(String filename) {
        String result = "";
        try {
            BufferedReader br = new BufferedReader(new FileReader(filename));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                sb.append(line);
                line = br.readLine();
            }
            result = sb.toString();
        } catch(Exception e) {
            e.printStackTrace();
        }
        return result;
    }


} 


A: Luckily for you there are already developed libraries to parse any JSON string, like the one's you provided. One of the most popular is
org.json
Using this you can write code similar to this:
import org.json.*;

String myString = ".." // The String representation you provided
JSONObject obj = new JSONObject(myString);
JSONArray arr = obj.getJSONArray("pList");

Another popular library for the same task is GSON

A: For the 2nd form, you have an JSONObject, but it contains some errors. Please fix them, or use a the 1st form again.
SOLUTION
I found some errors in the second file so I suggest the following edits:


*

*change "jumpToShopURL": nurl", to "jumpToShopURL": null,

*add a comma at the end of "description": "desc"

*add a comma at the end of "jumpToShopURL": "short url"
For the code, you can use the following lines:
    /*first file*/
    String jsonData = readFile("C:\\Users\\kbelkhiria\\Desktop\\Karim_JSON\\alt.json");
    JSONArray jarr =  new JSONArray(jsonData);

    /*array of first file's ids*/
    ArrayList<String> srcArray = new ArrayList<>();

    for(int i = 0; i < jarr.length(); i++) {
        srcArray.add(jarr.getJSONObject(i).getString("pId"));
    }

    /*second file*/

    // second form in a seperate file
    JSONObject obj = new JSONObject(readFile("C:\\Users\\kbelkhiria\\Desktop\\Karim_JSON\\alt2.json"));
    JSONArray arr = obj.getJSONArray("pList");

    /*array of second file's ids*/
    ArrayList<String> dstArray = new ArrayList<>();

    for(int i = 0; i < arr.length(); i++) {
        dstArray.add(jarr.getJSONObject(i).getString("pId"));
    }

    for (String string : srcArray) {
        if (dstArray.indexOf(string)==-1)
            System.out.println(string + " is missing in the second file");
    }


A: One possible solution using Jackson is the following:
private static final String JSON1 = // first json;

private static final String JSON2 = //second json;

public static void main(String[] args) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    List<LinkedHashMap> list1 = Arrays.asList(mapper.readValue(JSON1, LinkedHashMap[].class));
    List<LinkedHashMap> list2 = Arrays.asList(mapper.readValue(mapper.readTree(JSON2).get("pList").toString(), LinkedHashMap[].class));
    List<LinkedHashMap> missingItens = new ArrayList<>();
    for (LinkedHashMap o1 : list1) {
        if (!objectExistsInList(o1.get("pId").toString(), list2)) {
            missingItens.add(o1);
        }
    }
}

private static boolean objectExistsInList(String pIdValue, List<LinkedHashMap> objs) {
    for (LinkedHashMap map : objs) {
        if (map.containsValue(pIdValue)) {
            return true;
        }
    }
    return false;
}

Please keep in mind this is a very specific implementation to the given JSONs.
