fork download
  1. import java.util.ArrayList;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. Baza x = new Baza();
  7.  
  8. x.set.liczba(100);
  9. int y = x.get.liczba(0); // zerowy element?
  10.  
  11. System.out.println(y);
  12. }
  13.  
  14.  
  15. public static class Baza {
  16. private ArrayList<Integer> liczba = new ArrayList<Integer>();
  17. public get get;
  18. public set set;
  19.  
  20. private class get {
  21. public int liczba(int id) {return liczba.get(id);}
  22. }
  23.  
  24. private class set {
  25. public void liczba(int wartosc) {liczba.add(wartosc);}
  26. }
  27. }
  28.  
  29. }
  30.  
Runtime error #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
Standard output is empty