Skip to content
accelerando

SCJP, finally!

More than a year ago i decided to do the Sun Certified Java Programmer. Shortly after i bought this book, the projects at work and at home were somewhat overwhelming and after all, i realized that a big part of the SCJP is about some weird, crazy and sometimes wrong design decisions of the Java language. Some of them i mentioned under this tag.

Last month i realized i had some spare time, signed up at Prometric and had a 2nd look at the book and on my good Java experience from the last 6 years.

First thing: The “Java 5 Study Guide” isn’t a bad book but the “MasterExam” software on the enclosed cd is a master piece of crap. Not only the gui is as shitty as it gets but some of the answers are just plain wrong.

Second thing: I bought the preparation kit from Whizlabs for 50€. This thing isn’t bad at all and helps you get prepared for the craziness thrown at you.

Third: Being good at something is always great :D It rocks, really. Like single trail riding or music with electric guitars while driving open. It’s like drugs but not that unhealthy.

After about 2 weeks of preparing, I arrived 30 minutes early at “New Horizons” in Cologne, took the test certainly in english as i prepared with english material and finished somewhat 50 minutes later (you have officially around 3 hours to take the test). The nice proctor asked me if i wanted to use the toilet as she saw my report being printed: 90%, pass! Wooot!

I thought about this post at Jans. I really like the guy who wins a million dollars at Who wants to be a Millionaire and has the guts to call his dad but not ask for help and instead tells him he is going to win a million dollars. I can totally relate to that as i always had fun taking test and scoring at the upper limit :D

So today i’m gonna eat an extra portion of Cookies & Cream and leave you with the following piece of Java madness:

public class Braindead2 {
	public static void main(String[] args) {
		Integer i1 = 10;
		Integer i2 = 10;
 
		Integer i3 = 128;
		Integer i4 = 128;
 
		Integer i5 = new Integer(18);
		Integer i6 = new Integer(18);
 
		compare(i1, i2);
		compare(20, 20);
		compare(i3, i4);
		compare(i5, i6);
	}
 
	public static void compare(Integer i1, Integer i2) {
		System.out.println("Comparing " + i1 + " and " + i2);
 
		if(i1 == i2)
			System.out.print("same ");
		else
			System.out.print("different ");
		System.out.println("Objects");
 
		if(!i1.equals(i2))
			System.out.print("not ");
		System.out.println("meaningfully equal");
		System.out.println("---");
	}
}

To leave you with some fun, guess the output, leave a comment and mark the next paragraph with your mouse to see the correct answer:

Comparing 10 and 10
same Objects
meaningfully equal
---
Comparing 20 and 20
same Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---
Comparing 18 and 18
different Objects
meaningfully equal
---

2 Comments

  1. prego wrote:

    congrats michael! :-)

    Posted on 06-May-08 at 2:07 pm | Permalink
  2. Michael wrote:

    Danke, danke :)

    Posted on 06-May-08 at 2:08 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

*

Close
E-mail It