fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. class Student{
  7. public String name;
  8. public String surname;
  9. }
  10. /* Name of the class has to be "Main" only if the class is public. */
  11. class Ideone
  12. {
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15. Student a = new Student();
  16. a.name = "hello";
  17. a.surname = "heloooo";
  18. Student b = new Student();
  19. b.name = "helllllo";
  20. b.surname = "helooooooo";
  21. ArrayList<Student> students = new ArrayList<Student>();
  22. students.add(a);
  23. students.add(b);
  24. Gson gson = new GsonBuilder().create();
  25. String newstring = gson.toJson(matchList);
  26. System.out.println(newstring);
  27. }
  28.  
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:24: error: cannot find symbol
		Gson gson = new GsonBuilder().create();
		^
  symbol:   class Gson
  location: class Ideone
Main.java:24: error: cannot find symbol
		Gson gson = new GsonBuilder().create();
		                ^
  symbol:   class GsonBuilder
  location: class Ideone
Main.java:25: error: cannot find symbol
        String newstring = gson.toJson(matchList);
                                       ^
  symbol:   variable matchList
  location: class Ideone
3 errors
stdout
Standard output is empty