Last active
February 15, 2017 06:49
-
-
Save R00We/6e0e98932e5046f90bc7797dfcb88816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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