fork download
  1. class Ideone
  2. {
  3. public static void main (String[] args) throws java.lang.Exception
  4. {
  5. class Train{
  6. private int speed;
  7.  
  8. public Train(int s){
  9. speed = s;
  10. }
  11. public int getSpeed(){
  12. return speed;
  13. }
  14. public void up(){
  15. speed++;
  16. }
  17. public void down(){
  18. speed--;
  19. }
  20. }
  21. }
  22. }
Success #stdin #stdout 0.08s 54636KB
stdin
Standard input is empty
stdout
Standard output is empty