Skip to content

Instantly share code, notes, and snippets.

@yenerm
Created April 17, 2020 19:39
Show Gist options
  • Save yenerm/5bfa65e308e8e973fa025d031241d07b to your computer and use it in GitHub Desktop.
Save yenerm/5bfa65e308e8e973fa025d031241d07b to your computer and use it in GitHub Desktop.
anonymous class via object expression
<!-- 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