Created
November 22, 2014 12:07
-
-
Save sreeprasad/7a6a56717ef94fc70c21 to your computer and use it in GitHub Desktop.
Any method reference of a method that takes no parameters and returns void of a class can be used as code for Thread
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 ExampleTwo { | |
| public static void myExample(){ | |
| System.out.println("Hello there, you have reached personal website of Sreeprasad"); | |
| } | |
| public static void main(String[] args) { | |
| Thread t = new Thread(ExampleTwo::myExample); | |
| t.start(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment