Puzzle and JavaSpecialists Slack Channel By Dr Heinz M. Kabutz A wonderfully good morning to you, About 10 days ago, we launched the JavaSpecialists Slack Team. Slack is like IRC with lipstick. Best description I heard is "hipster IRC". But don't let that put you off. Even IRC was fantastic - with the right people. To join us, all you have to do is click here and you'll automagically be sent an invite to the team.
In our industry, knowledge has a 3 year half-life. So of all the things you knew 3 years ago, only half is useful today. That is scary. It means that we need to continue learning and educating ourselves. This includes all of us, me too. I am currently learning Swift, but next on the menu will most likely be Kotlin. Maybe I'll give Groovy another chance. Or Clojure. It is good to stay fit intellectually.
I made a five minute video for my friend Bruno Souza's (the JavaMan of Brazil) code4.life initiative where I talk about the need to take responsibility for your own career development.
Back to the Slack Team. We now have over 1400 members and also a publicly visible archive of the discussions. I do not intend this to be a secret club, but an open exchange of ideas surrounding Java (mostly). You can see the archive by clicking here.
We will add new channels as it makes sense.
Here is a puzzle that I posted on the #random channel today:
You job is to look at the code and figure out what it will output. Either first "Hello Slackers!!!" and then "We love sharing knowledge :-)" or the other way round. Once you've decided what order it is, run it and confirm that you are correct. If not, then you need to figure out why it isn't what you expected. The next job is to replace the anonymous inner class with a lambda and then run the code again to see if anything changes. Good luck! public class SlowGreeter { static { new SlowGreeter(); }
private static void sayHello() { System.out.println("Hello Slackers!!!"); }
public SlowGreeter() { Thread thread = new Thread(new Runnable() { public void run() { sayHello(); } }); thread.start(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
public static void main(String... args) { System.out.println("We love sharing knowledge :-)"); } } Please remember, if you'd like to join our team, just click here and you'll get an invite from Slack delivered to your inbox (or SPAM folder) a few seconds later. Kind regards Heinz -- Dr Heinz M. Kabutz (PhD CompSci) [email protected] Author of "The Java(tm) Specialists' Newsletter" Sun/Oracle Java Champion since 2005 JavaOne 2012 Rock Star http://www.javaspecialists.eu Skype: kabutz
|