title: Convert JSON file to String
body: <p>I am pretty new to Java and have an issue that I don't know how to fix. I read a few tutorials, posted questions etc. but I was still not able to understand how to Transfer the knowledge Fixing my Problem. </p>
  
  <p>Here to Problem.</p>
  
  <p>I want to read multiple json files all at one place and convert the data to Strings. I am able to read one data entry in the json, but not more. :-|</p>
  
  <p>The file data Looks as follows:</p>
  
  <pre><code>{
      "Header":{
          "Liste1": {
              "ID": "12345",
              "Name" : "customerlist",
              "Company List": [
                  "Company": "c1",
                  "Company": "c2",
                  "Company": "c3"
              ]
          },
          "Liste2":{
              "ID": "12346",
              "Name" : "vendorlist",
              "Company List": [
                  "Company": "c4",
                  "Company": "c5",
                  "Company": "c6"
              ]
          }
      }
  }
  </code></pre>
  
  <p>The code I used Main:</p>
  
  <pre><code>package testpaket;
  
  import com.google.gson.Gson;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.Reader;
  
  public class test6 {
  
      public static void main(String[] args) {
  
          Gson gson = new Gson();
  
          try (Reader reader = new FileReader("test.json")) {
  
              // Convert JSON to Java Object
              Header header = gson.fromJson(reader, Header.class);
              System.out.println(header);
  
              // Convert JSON to JsonElement, and later to String
              /*JsonElement json = gson.fromJson(reader, JsonElement.class);
              String jsonInString = gson.toJson(json);
              System.out.println(jsonInString);*/
  
  
  
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>My Lists class.</p>
  
  <pre><code>package testpaket;
  
  import java.util.List;
  
  public class Lists {
  
      private String List;
      private int ID;
      private String Name;
      private List&lt;String&gt; companyList;
  
  }
  </code></pre>
  
  <p>My Header class.</p>
  
  <pre><code>package testpaket;
  
  import java.util.Map;
  
  public class Header {
  
          String name;
          String list;
          int id;
          String header1;
  
  
          private Map&lt;String, Lists&gt; header;
  
  
          //getters&amp;setters
          public String getHeader() { 
                return this.header1; 
          }
          public void setHeader(String header) { 
              this.header1 = header1; 
          }
          public String getList() { 
                return this.list; 
          }
          public void setList(String list) { 
              this.list = list; 
          }
          public String getName() { 
                return this.name; 
          }
          public void setName(String name) { 
              this.name = name; 
          }
          public int getID() { 
                return this.id; 
          }
          public void setID(int id) { 
              this.id = id; 
          }
  }
  </code></pre>
  
  <p>Does any of that even make sense? Sorry, but I really tried transfering the knowledge I have so far. Could anyone please help me and tell me how to fix it?</p>