Here's a class named SomeClass:
class SomeClass {
@Synchronized
fun method1() {
println("a thread entered method1")
method2()
println("a thread left method1")
}
@Synchronized
fun method2() {
println("a thread entered method2")
println("a thread left method2")
}
@Synchronized
fun method3() {
println("a thread entered method3")
println("a thread left method3")
}
}
Two threads have a reference to one instance of the class. The first thread invokes method1, and the second thread invokes method3 at the same time. Select all possible outputs: