Created
April 17, 2020 19:39
-
-
Save yenerm/5bfa65e308e8e973fa025d031241d07b to your computer and use it in GitHub Desktop.
anonymous class via object expression
This file contains 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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
val t1 = Thread(object : Runnable { | |
override fun run() { | |
//do something | |
} | |
}) | |
t1.start() | |
//Decompiled Java | |
Thread t1 = new Thread((Runnable)(new Runnable() { | |
public void run() { | |
} | |
})); | |
t1.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment