Skip to content

Instantly share code, notes, and snippets.

@maxandersen
Created July 14, 2023 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxandersen/7ea9c5941b81365e965dbda1ffef20bb to your computer and use it in GitHub Desktop.
Save maxandersen/7ea9c5941b81365e965dbda1ffef20bb to your computer and use it in GitHub Desktop.
//JAVA 21+
//PREVIEW
// Make this available in a library somewhere
public interface ConsoleApp {
default void println(String s) {
System.out.println(s);
}
default void print(String s) {
System.out.print(s);
}
default void printf(String s, Object... args) {
System.out.printf(s, args);
}
}
public class main implements ConsoleApp {
void main() {
print("Hello World!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment