https://kotlinlang.org logo
#random
Title
# random
k

kirillrakhman

12/22/2016, 2:35 PM
something I find funny everytime is that because Java is so verbose by default, even the official docs have to resort to a compressed syntax that you would never see in real code. example: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/BlockingQueue.html
Copy code
class Producer implements Runnable {
   private final BlockingQueue queue;
   Producer(BlockingQueue q) { queue = q; }
   public void run() {
     try {
       while (true) { queue.put(produce()); }
     } catch (InterruptedException ex) { ... handle ...}
   }
   Object produce() { ... }
 }
- no
public
on the class - constructor body in the same line as signature - single line
while
- single line
catch
- missing
@Overrides