Tomasz Kaczmarzyk

Greenhorn
+ Follow
since Mar 05, 2010
Tomasz likes ...
Firefox Browser Java Linux
Merit badge: grant badges
For More
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 Tomasz Kaczmarzyk

Hi,
I've just passed EJB 3.1 exam with 95% During the exam I noticed few errors in questions, for instance:



is an obvious compilation error, but all the answers were asuming that code will compile and run.

I would like to report those issues to Oracle (or Pearson VUE?), but I couldn't find any information about how to do it (IMHO their website is quite bad).

Has anyone got any experience with similar case?
Could you tell how long is validity time of the voucher now? I heard that this is 1 year, but i'm not sure.
I have related question about hashCode() % capacity concept.

In many scjp mocks and in Kathy Sierra & Bert Bates book there are questions like this:

class Test {
int i;
Test(int i) {this.i = i;}
public boolean equals(Object o) {return ((Test)o).i == this.i}
}

HashSet s = new HashSet();
s.add(new Test(1));
s.add(new Test(1));

System.out.println(s.size()); // what will be the output?



Now the problem: authors say that 2 is correct answer -- "because hashCode() is not overriden, so two object will go to different buckets."

BUT! I think that even when each hashCode is unique, there is posiibility that hash1%capacity == hash2%capacity AND then the output is 1.

What do You think about it?