Skip to content

Instantly share code, notes, and snippets.

@R00We
Last active February 15, 2017 06:49
Show Gist options
  • Save R00We/6e0e98932e5046f90bc7797dfcb88816 to your computer and use it in GitHub Desktop.
Save R00We/6e0e98932e5046f90bc7797dfcb88816 to your computer and use it in GitHub Desktop.
public class Main {
private static class ConsolePrinter implements Runnable {
// private final String text = "my text"; Модификатор final говорит нам, что переменная должна быть установлена только 1 раз
private final String text;
private ConsolePrinter(String text) {
this.text = text;
}
@Override
public void run() {
System.out.print(text);
}
}
public static void main(String... args) {
new Thread(new ConsolePrinter(args[0])).start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment