Tse Wu

+ Follow
since Jan 05, 2012
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tse Wu

Think about it this way, if you have an animal class and a dog and cat class that extends animal. And you have a method that accepts <? extends animal>, this is saying you could pass anything that is a subclass of the class animal into this method. Now say that you have a dog collection and you pass that dog collection into the method, and in that method you try and add a cat.. now you have a collection of dogs and cats in the dog collection. To prevent this the compiler will not allow adding to the collection using the extend keyword.
Thanks all.

Glen Iris wrote:Congratulations Tse Wu.

How many practice exams did you complete before taking the test?

What sort of scores were you getting on your last few practice exams?

I took both practice exams in the book, first time I scored a 55 and the second time was 60. I didn't do the timed test and took my time to solve the issues. From what I have gathered if you scored about this range passing shouldn't be a problem. I also started on the supplemental practice exam book but never got far with it since I ran out of time to prepare. Let me know if you need help on the topics.
12 years ago
I think it is a safe bet that you are better off reading the entire K&B book, the only thing that was not on the exam for me was serialization.
Just passed the exam despite of leaving 5 questions unanswered due to lack of time. Got a 73, I think I could've gotten higher but I am glad to score above 61.

The exam itself was less complex compared to the K&B practice exams, I think because the way I took these practice exams I reviewed simple answers 3 or 4 times before moving on. That killed most of the time for me in retrospec. The takeaway for me was studying the practice exam questions, other than memorizing APIs and rules. I didn't encounter any serialization questions like everyone said, and I came across more .io questions than i would've liked. And the questions went from simple to hard instead of a random mix. Hope this helps.
12 years ago
Hi Matt,
From my understanding.

Step1: Since the first y is post decrement, the first y value is 1.
Step2: After the resolution of the first y, y is decreased to 0.
Step3: The second y is also post decrement, so the second y value is assigned to 0.
Step4: after the resolution of the second y, y is decreased to -1.
Step5: so we ended up with 1 + 0
Step6: At this point y is -1, but since 1 + 0 is 1 the assignment of y changed from -1 to 1 at this point.

I think this is how it goes with the explanation you provided which made sense. Let me know if one of the steps was wrong. Thanks again.
Thanks Matt.
Y ended up not being -1 due to the fact that the final value was assigned as the sum of the expression. Essentially y was -1 before being reassigned to 1.. Do I have the jist of it?
Hi, why is the following 1?

int y = 1;
y = y-- + y--;

Hi Mallik,
It should be

new SameRun().run("Overloaded");
"This class implements the Set interface, backed by a hash table (actually a HashMap instance). It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time. This class permits the null element."


I think the key to understand this concept is knowing the difference between sorted and ordered. HashSet is unsorted and unordered.
I think it should be the following

public void checkAnimals(List<? extends Animal> animals)

Since passing List is a type of <Dog>, <Cat> or <Bird> you cannot pass the <Dog> type into an <Animal> type directly other than extending it with ?.