可调试性 Always provide a toString() method What’s next? 可调试性 This chapter contains considerations about debuggability. Always provide a toString() method To make debugging easi...
Shared mutable state and concurrency The problem Volatiles are of no help Thread-safe data structures Thread confinement fine-grained Thread confinement coarse-grained Mutual ...
Nested and Inner Classes Inner classes Anonymous inner classes Nested and Inner Classes Classes can be nested in other classes: class Outer { private val bar : ...
Callbacks Passing a closure to a C function Raises annotation Callbacks You can use function types in C declarations: lib X # In C: # # void callback(int (*...
Callbacks Passing a closure to a C function Raises annotation Callbacks You can use function types in C declarations: lib X # In C: # # void callback(int (*...