fork download
  1.  
  2. //box that holds contents of a type.
  3. class Box<type>
  4. {
  5. type contents;
  6. Box(type contents)
  7. {
  8. this.contents = contents;
  9. }
  10. }
  11. class Tester
  12. {
  13. public static void main (String[] args)
  14. {
  15. Box box = new Box<String>("string");
  16. System.out.println(box.contents);
  17. }
  18. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
string