Coding Global Background
Coding Global

Problem with gson.fromJson()

Archiviert 2 years ago
24 Nachrichten
1 Mitglieder
2 years ago
In Discord öffnen
S
Splayfer

Hello together, i just want to read a json object from a .json file using gson.fromJson(reader, Type.class) but it doesnt work :( ```java public void doSomething() throws IOException { Gson gson = new Gson(); BrawlPlayer[] array = gson.fromJson(new FileReader("PATH"), BrawlPlayer[].class); } ``` The return value for the fromJson() function is always null. I'm getting no errors even with try catch and writing values works just fine but reading doesnt

Antworten (24)