using our OCA 8 book to study for the OCA 7?

Main menu:

Topics

Recent Posts

Blog

April 2015
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
27282930  

Past Posts

Java/Java EE

JDBC

Other

using our OCA 8 book to study for the OCA 7?

April 19th, 2015 by Jeanne Boyarsky

As of now, Oracle isn’t allowing developers to take the OCA 8 + OCP 7 to get OCPJP 8 certified. This means that some readers who have already bought our OCA 8 book might want to take the OCA 7. (In particular, those who need to get OCPJP certified by September or so and don’t want to take the beta exam.) Those new to Java/certs and just starting out now aren’t likely to find this constraining and can take the OCA 8.

Timeline

I’m predicting the OCP 8 exam will be released in September because:

  • The beta is launching April 25th.
  • I’m guessing they will give two months taking us to June.
  • Then Oracle needs 10 weeks to prepare the real exam taking us to September.

The beta is good because is is $50. It is bad because it is longer and you don’t get your score for months.

How do I “backport” the book for the OCA 7 exam

This matrix compares the OCA 7 and OCA 8 exams. This means you can read the OCA 8 book to study for the OCA 7 exam with the following changes:

  1. Skip the section on dates/times in Chapter 3.
  2. Skip the section on lambdas/predicates in Chapter 4.
  3. Skip the parts about static/default methods in interfaces in Chapter 5.

You’ll slightly overstudy this way. For example, OCA 7 doesn’t ask you to describe encapsulation. But not by any significant amount.

What JDK should I use?

Remember to either use a Java 7 JDK or compile with the -source 1.7 flag. For example:

javac -source 1.7 Jeanne.java

This will ensure you aren’t accidentally relying on a Java 8 feature. For example, the final keyword works a bit differently in Java 8. Not in a way that affects the OCA exam scope. But you could get confused if compiling with a different version

 

jeanne and scott’s first book – with picture

March 29th, 2015 by Jeanne Boyarsky

The book has either been out for three months or six weeks depending on how you count. (The e-book was released earlier). A couple weeks ago, Scott and I took a picture with the book:

scott-book

 

We’ve also learned that Amazon has a page called authorcentral.amazon.com which shows you “real time” book stats:

stats

 

Well real time with three disclaimers:

  1. It’s updated weekly.
  2. It only includes US sales.
  3. It only includes printed book sales.

While it is bizarre to me that Amazon doesn’t include Kindle sales, it is cool seeing the map. The NY area has the most sales which isn’t surprising. Scott and I both live in the tri-state area and have therefore told the most people there. DC and Dallas were second and third.

playing with scratch

March 17th, 2015 by Jeanne Boyarsky

Scratch is an intro programming language for kids. (Like Logo was, but way better). When I saw edx was offering an Intro to Scratch course, I decided to take that opportunity to learn it. It’s cute and a great starting point for programming. It offers the ability to write a really simple program. But it also lets you learn about lists and event handling.

For my final project for the course, I wrote a two player game of tic tac toe. Here’s what jumped out me when doing the project.

Components used

  1. Multiple sprites and event handling (broadcast/wait)
  2. Key and mouse listeners
  3. Functions (custom blocks)
  4. Logic (loops/conditionals)
  5. Lists
  6. Comments

What I missed

As a programmer used to full fledged (non-simplified) programming languages and environments, there are a few things I missed.

  1. Real 2D arrays. I used a string in a 1D array and getting the character at each position.
  2. Grouping parens. I wanted to write something equivalent to (a==b and b==c) or (d==e and e=f)). While this possible to do in Scratch, it uses the layering of blocks rather than parens so is hard to read. I wound up splitting into two if statements.
  3. Local variables. There are “sprite only” variables, but they still clutter up the namespace and make it hard to find the variable you need at a given point.
  4. elsif/elseif. Yes, you can nest if/else statements. But harder to read.
  5. I didn’t work on the program for two weeks and went back to it. I really wanted “search” functionality to find uses of a variable or where a custom block was defined.
  6. I miss having rollback/history for changes. When the program “used to work” and then doesn’t, it’s hard to figure out what you accidentally drag and dropped.

 

Other interesting points

  1. Scratch uses 1 based indexes. Makes sense for a first language to break with the odd tradition practically ever other language uses. But feels weird.
  2. There is no distinction between character and numeric types. This meant I could get a character out of a string and use it as a loop index.
  3. Regular mode and turbo mode allows you to control the speed the sprites draw. This is useful when drawing things like circles. When coding, turbo mode is enabled with Edit > Turbo Mode. When in the play view, it is enabled by holding shift when pressing the green flag to start. I wish there were a way to either “save” with turbo mode or turn turbo mode on in the code.
  4. There are blocks for length of on list and and operator/string. Calling the wrong length block on a list doesn’t fail, but does return unexpected data.

Refactoring?

  1. I have some duplication in drawO vs draw X and if statements when drawing the grid. I could put in variable but didn’t feel like it was clearer that way. Similarly in calculating if the a player won.
  2. I also have duplication in “when I receive move” if statements. I got lazy when drawing the line.