Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for Shut down the computer!

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
Jun 26, 2018 at 19:05 comment added Jakob This should be labeled as a Linux-specific answer, e.g. "Java on LInux".
Jan 26, 2017 at 13:09 history edited Tom CC BY-SA 3.0
edited body
Jan 26, 2017 at 12:23 comment added Olivier Grégoire ()->{Runtime.getRuntime().exec("init 0");} or tentatively ()->Runtime.getRuntime().exec("init 0") (can't check at the moment). It's a lambda implementing a custom void, no-args-throwing interface.
Jan 25, 2017 at 13:11 history edited Tom CC BY-SA 3.0
Shortened code with a function, so Java 8 is not needed because an interface isn't used
Jan 25, 2017 at 1:32 comment added jpmc26 Wouldn't the Linux version be a bit shorter?
S Jan 24, 2017 at 19:54 history suggested Harris CC BY-SA 3.0
Interfaces don't allow the use of static below Java 8
Jan 24, 2017 at 19:13 review Suggested edits
S Jan 24, 2017 at 19:54
Jan 24, 2017 at 18:12 comment added user18932 You can use a method, since the question did not specify the submission must be a full program: void f()throws Exception{Runtime.getRuntime().exec("shutdown/s");}
Jan 24, 2017 at 16:43 history edited Tom CC BY-SA 3.0
added 17 characters in body
Jan 24, 2017 at 15:42 comment added Pavel It's shorter to replace class with interface as that allows you to omit public from main.
Jan 24, 2017 at 15:18 history edited Tom CC BY-SA 3.0
added 7 characters in body
Jan 24, 2017 at 15:08 history answered Tom CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /