Did you know Set.of does that?

I was working on some code and need to turn an array into a set. I knew that Set.of() has a varargs overload so I tried to use it. And promptly learned that it doesn’t work for my needs.

How many ways can you think of that set1 and set2 differ here?

String[] words = { "all", "the", "words", "in", "the", "world" };

Set<String> set1 = new HashSet<>(Arrays.asList(words));

Set<String> set2 = Set.of(words);

Immutability

set2 is immutable while set1 is not. I knew that going in. I don’t need to modify the set I’m creating so that’s fine.

Uniqueness

set2 doesn’t get created if there are duplicates in words. set1 does. This is a big difference and caught me by surprise. And what better way to deal with a surprise than make it a blog post? Surprise! (And yes, this in the JavaDoc. So if I had read the exception details in the JavaDoc, I wouldn’t have been surprised.)

Jeanne’s experiences taking the 1Z0-815 exam

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.

I wasn’t as fast as Scott who took the exam two months ago (the day after it came out). I waited until I was done with “FIRST robotics season” and a vacation before thinking about taking the first half of the new Oracle Certified Professional: Java 11 Developer certification. I passed today with an 87%.I’ll be taking the second half in a number of months.

Jeanne vs Scott’s exam

A lot changed since Scott took the exam. I think he got a lot of experimental/unscored questions. The exam was still harder than the OCA 8. But it wasn’t insanely hard like he got. Key differences:

  • Scott had a lot of “pick 3 or 8” type questions. About 75% of the questions I got were pick one out of four or five choices. I got exactly 4 questions with seven choices. One was “pick 3 or 7” and three were “pick 1 of 7”. I got about 6 questions with 6 answers. Two were “pick 2 of 6” and the others were “pick 1 of 6”. I got about 12 “choose 2 or 5” questions.
  • I got 7 questions on modules. Which is what you’d expect statistically. Scott had a lot more but I think that was because the topic was new and Oracle was testing questions.

What is still harder

  • Overall, it is longer than the OCA 8. It took me 75 minutes to get through all the questions on the first pass. Then I spent 50 minutes reviewing (and memorizing). During that phase, I fixed one incorrect answer and changed a correct answer to an incorrect answer so it was a wash.
  • The scope is larger than the OCA 8 and the questions go deeper. This makes sense as this is a professional level exam.

What else was interesting?

  • The instructions say press control to cross out answers. This didn’t work. (I had this problem before so it might be my exam center.) – update: this worked on part 2, so it was probably just the mouse at my testing center
  • The exam results are supposed to be available within 30 minutes. I didn’t bring my phone to the exam center. When I got home, the email with the results was from “30” minutes ago. It took me a little over half an hour from when I ended the exam until I go home so he results were available fast!

How I studied

Even though I’m the author a study book, I find I still need to review. More so for part 2 of the exam, but it still helps for part 1 seeing the details.

  • Read our OCA 8 book
  • Re-read the basic parts of Manning’s Module System book. I was the tech development editor for this book and also helped with some of the finishing touches.
  • Do all questions in our OCA 8 book and K&B’s 8 book.
  • Do about half the questions in our Practice exam book for OCA 8 and the mock exam. (I ran out of time to do them all. This was mainly about practicing speed and confidence anyway. I do know the material.)
  • Did the official practice questions. (It would have been better if these were split between part 1 and part 2)

Listening to Free Music on a ChromeBook

My mother decide she’d like to listed to music on here Chromebook. Conveniently the new Chromebook has good speakers. The gotcha is that she has limited bandwidth at home.

Luckily, this is still possible via a “simple three step procedure”

Step 0 – pre-req

  • Go to Amazon Play on the Chromebook and download the Amazon music app
  • Right click the Amazon music app and pin it. That way it always shows up on the bottom
  • Login to the Amazon music app using the account with a Prime membership. Note this must be the actual account with a Prime membership. Not one you merely shared free shipping with. (Amazon allows up to 10 devices with access to the music on a single Prime account so they must be ok with families sharing)

Step 1 – pick Amazon Prime songs

  • Go to Amazon Digital Music
  • Search for what you are interested in
  • Filter by Amazon Prime on the left
  • This will give you a list of albums with at least one free prime song
  • Each one tells you how many songs are included with prime
  • Click on the albums you are interested in
  • Click “Add” and the icon turns into “Listen now”. This makes it accessible via the app

Step 2 – download to Chromebook while on free wifi

While my mother is bandwidth limited at home, she has free wifi in the lobby and at the library. So for this step:

  • Open Amazon Music on the chromebook
  • Go to My Music. I had tow wait about two minutes for the new songs to show up
  • For each song, click the three dot icon at right and choose Download

Step 3 – listen to music on Chromebook

  • Without being online, open Amazon Music
  • Choose “Offline Music”
  • Click “Shuffle all”
  • Click “play” on first song. Then they all play