This Book is *Not* a Study Guide

Well, technically it is. But what I really mean is our new OCP 11 Java Programmer II Book is so much more than that. In fact, it’s my favorite book we’ve written (don’t tell my other books!) because it dives deep into some really interesting topics like streams, concurrency, I/O and NIO.2, method references, etc that people often only have passing familiarity with.

It’s not written solely for you to pass the exam (although it contains plenty of strategies/tips/tricks for that too!). For example, maybe you’ve used annotations but been too scared to write you own? This book will teach you everything you need to know about writing custom annotations like a pro. Or maybe you’ve heard about lambdas and streams but don’t really understand them well enough to use them. Completely understandable! I was once terrified to use them too, for fear of looking unintelligent (aka dumb). Now, I use lambdas, streams, and method references to accomplish in a handful of lines what used to take me pages of boiler plate code.

Whether you take and pass the exam or not (and I sincerely wish you do), I hope that by reading this book you’ll gain a greater understanding and appreciation of Java. Oh, and if you’re more just starting out, I recommend reading our OCP 11 Java Programmer I Book first. That provides a solid foundation for Java classes, methods, and polymorphism.

If I sound excited, it’s because I am really proud of this book and all of the hard work that went into making it interesting, easy-to-understand, and perhaps… a bit of fun! Purchase now on Amazon while supplies last!

Happy Book Birthday! New OCP 11 Book Now Shipping!

Update (11/05/2020): Read The 1Z0-819 Exam page to learn how you can easily our Java 11 Study Guides to prepare for Oracle’s 1Z0-819 Exam, as well as the 1Z0-817 Upgrade Exam.

Jeanne and I are thrilled to announce the release of our new Java 11 OCP Programmer II Book! It’s been a challenging road, writing and editing a book in the middle of a global pandemic, and we’re excited the print book is available for sale and finally shipping! The Kindle/digital version is available too!

Whether you’re studying for the 1Z0-816 Programmer II Exam or the 1Z0-817 Upgrade Exam, or just enjoy finding out about new Java topics, this book contains it all. We pride ourselves in presenting lambda expressions, streams, concurrency, custom annotations, I/O and NIO.2, JDBC, security, and more in fun and refreshing ways. We want our readers to enjoy learning about a topic just as much as we enjoyed writing about it. Finally, we believe that becoming certified makes you a more well-rounded developer and helps to grow your career with potential employers.

Our last book sold out pretty quickly, so get your copy today!

java is smart – using var

I was working on some code and seeing how many local variables I could substitute with var. I was a little surprised to learn that the below compiles. It makes sense to me that mags is good because the type is there. It’s cool that years and sorted can infer the type of Integer as well.

package lists;

import java.util.*;

public class Magazines {

    public static void main(String[] args) {
        var mags = new HashMap<String, Integer>();
        mags.put("People", 1974);
        mags.put("Readers Digest", 1922);
        mags.put("The Economist", 1843);

        var years = mags.values();

        var sorted = new ArrayList<>(years);
        Collections.sort(sorted);

        int first = sorted.get(0);
        System.out.println(first);
    }
}