fork download
  1.  
  2. // http://stackoverflow.com/a/11026642/348975
  3.  
  4. class Main {
  5. public static void main ( String [ ] args ) {
  6. Light light = new Light ( ) ;
  7. light . Switch(Light.LightSwitch.On) ;
  8. }
  9. static class Light {
  10. private LightSwitch position;
  11. private enum LightSwitch {
  12. On,
  13. Off
  14. }
  15. public void SwitchOn() {
  16. Switch(LightSwitch.On);
  17. }
  18. public void SwitchOff() {
  19. Switch(LightSwitch.Off);
  20. }
  21. public void Switch(LightSwitch pos) {
  22. position = pos;
  23. }
  24. }
  25. }
Success #stdin #stdout 0.06s 215488KB
stdin
Standard input is empty
stdout
Standard output is empty