fork download
  1. public class Node {
  2. private int value;
  3. private Node next;
  4.  
  5. public Node(int value) {
  6. this.value = value;
  7. this.next = null;
  8. }
  9.  
  10. public Node(int value, Node next) {
  11. this.value = value;
  12. this.next = next;
  13. }
  14.  
  15. public Node() {
  16. this.value = 0;
  17. this.next = null;
  18. }
  19.  
  20. public int getValue() {
  21. return value;
  22. }
  23.  
  24. public void setValue(int value) {
  25. this.value = value;
  26. }
  27.  
  28. public Node getNext() {
  29. return next;
  30. }
  31.  
  32. public void setNext(Node next) {
  33. this.next = next;
  34. }
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Node is public, should be declared in a file named Node.java
public class Node {
       ^
1 error
stdout
Standard output is empty