Skip to content

Instantly share code, notes, and snippets.

@phoenix24
Created December 23, 2018 22:07
Show Gist options
  • Select an option

  • Save phoenix24/9f6195ca19d7e61783a0f55937b2b48a to your computer and use it in GitHub Desktop.

Select an option

Save phoenix24/9f6195ca19d7e61783a0f55937b2b48a to your computer and use it in GitHub Desktop.
java playground - tell me output.
package io.zapscanner.admin;
public class SP14 {
static class R extends Thread {
@Override
public synchronized void start() {
System.out.println("in start, t:" + Thread.currentThread().getName());
}
@Override
public void run() {
System.out.println("in run, t:" + Thread.currentThread().getName());
}
}
public static void main(String[] args) {
R r = new R();
Thread t = new Thread(r);
t.start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment