Brad Clarke

Greenhorn
+ Follow
since Mar 27, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brad Clarke

Go to the link and add it to the shopping cart.

Once in the cart, you have the option of changing the currency.
Neither one of those examples will compile for me as posted.

...println should be printf.

As was stated previously, the %s formatting likely calls the toString() method on the Long wrapper class.

As for the boolean, the %b conversion character returns true for any non-null or non-boolean value. If you replaced the 123 with "A", it still prints true.
[ July 11, 2007: Message edited by: Brad Clarke ]
Joseph, I can somewhat relate to what you are feeling.

Where I work, the powers that be decided that everyone in our unit has to obtain Java certifications. I was asked in early June to write the Java 5 exam by the end of the month, as they had vouchers that were going to expire at the end of June and they would rather have someone use the voucher and possibly pass the exam vs letting the voucher go to waste. When I was asked to write the exam, I was at the end of chapter 3 in the K&B Book.

In a 3 week period I had to read 7 more chapters, absorb, and practice everything in the book, plus take a bunch of Whizlabs practice exams. I managed to do it, but it was very painful since I hadn't done much in Java in the last 2 years, let alone anything to do with Java 5.

I have the dubious distinction of being the first person in our group in over a year to fail the exam. I missed it by 4 questions.

Was I frustrated? You bet....I put a lot of time and effort into preparing for the exam, but it was not enough. By the time it came to write the exam, I was burned out from information overload. It's been a week since I wrote the exam, and there are things that I read and practiced that I am just now starting to fully understand now.

I'll try the exam again within the next month or so, after I have addressed the areas that I need to work on.

Find some good mock exams and use them. When you get a question wrong, figure out why you got it wrong. Write lots of little programs. This is where I went wrong. Due to my accelerated schedule, I didn't have the time to stop and address my problem areas.
-classpath com:. tells the compiler to look in the com package (under the current directory) as well as the current directory (the "." means current directory) for classes that Foo.java and Bar.java need to compile.

-g tells the compiler to generate debug information.
Maybe so, but the code won't compile if you do that.

D:\Development\Java5\InstanceTest.java:28: inconvertible types
found : Foo[]
required: Foo
System.out.println("Foo[] instanceof Foo: " + (fooarr instanceof Foo));
This is what I came up with that compile clean and gives the expected results as indicated in table 4-1. No idea if this is the type of code they had intended to result in the output though.

I joined the club as well.

Missed passing by 4 questions.

Collections/Generics killed me.

I didn't have the option of rescheduling the exam, as the voucher my employer gave me expires tomorrow, so they would rather have someone use it and possibly pass the exam than to have the voucher expire and have the money totally wasted.

Oh well, I've seen what the real exam is about and know what to expect th next time.
I've been coding in Java on and off since 2000 and there are things I've seen in the K&B book and the Whizlabs exams that made me go "WTF is that?".

I've got 7 years of Java, but I have not had to use a large percentage of the stuff available in Java. A lot of my experience is working with classes that are not on the exam. Collections are my downfall, as I've never had to use anything other than ArrayLists to accomplish what I needed to do.

The majority of questions I have failed on the Whizlabs exams have been Collection related.

All of my co-workers tell me that the Whizlab exams are harder than the real one....I guess that's not always the case.
suhem, I've been the same way.

I failed the first and third Whizlabs sample exams, passed the second one.

As was explained to me by my co-workers, the key is to understand why you got a question wrong. Write the code, compile it, see what it does or doesn't do. That has helped me.

I rewrote the first sample exam last night and passed it. I'll rewrite the third one later today and then take the final Whizlab exam on Thursday.
This is just me more or less thinking out loud as i'm still not getting why 5 is printed and not 6.

Based on what the JLS says, the definition of x in class B "should" be hiding the definition of x in class A, but it doesn't appear to be in this scenario.

When the code executes, it runs the overridden version of getObject() that returns a B, says that it's in the B method, yet we end up with the x value from class A. Even if you define variable c as type SubCovariantTest it still prints out 5. EDIT - When c is type SubCovariantTest, it prints out 6. Not sure what I did last night, but it wasn't right
[ June 22, 2007: Message edited by: Brad Clarke ]
Not that it helps any, but when I traced through it, I also came up with 6.

I played around with the code, thinking maybe it had something to do with the accessibility of the "int x" values in the super and sub classes (A & B), but nothing panned out.
[ June 20, 2007: Message edited by: Brad Clarke ]
This particular exercise baffled me, but for a different reason this time

The verbiage of the question states "You can check Chapter 6 for StringBuffer methods that will help with this." so I took it literally to mean that the only methods that applied to the exercise were the ones discussed in the StringBuffer/StringBuilder section in chapter 6.

The charAt() and setCharAt() methods were never discussed in the context of StringBuffers/StringBuilders in Chapter 6.
[ June 20, 2007: Message edited by: Brad Clarke ]

Originally posted by Dick Eimers:

The amount of errors in this book is starting to annoy me. I've paid 60 euros -- about 70 dollars-- for this book and it is packed with errors.


Compared to the fifth edition of the Heller and Roberts book (absolute crap IMHO) the K&B book is fantastic!!!

I'd rather have some typos compared to having critical exam objectives totally ignored
I am studying for SCJP 5.

My reasons?

1. Required by employer to meet corporate requirements related to solution centres.
2. I chose SCJP 5 since it is the latest version.
3. I expect the 1.4 exam will be phased out at some point in the near future. No sense studying for 1.4 and then have to take an upgrade exam down the road.
[ May 02, 2006: Message edited by: Brad Clarke ]