This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Sean Lim

Greenhorn
+ Follow
since Oct 01, 2009
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 Sean Lim

Great! Thank you so much!
Hi guys,

I am wondering what methods I need to know for the File/FileReader/FileWriter.. etc classes. Are all the methods mentioned in the K&B book enough?
Hi guys,

I was reading through the K&B SCJP 6 book and maybe I read it wrong but it said that <?> was equivalent to <? extends Object>. I was wondering if that is true. I am asking because of a little inconsistency I saw when trying out some code. When running the below code it compiled just fine.



But compiling it with <? extends Object> I got a compiler warning.



Can somebody clarify this for me. Thanks in advance.
Thanks so much for the explanation, Wouter!!
Hi guys,

I was trying to solve these Generic questions on http://nikojava.wordpress.com/2008/10/09/scjp-mock-exam-for-generics/#scjp-generics-1

Question #39:

I can't figure out why this is giving me a compiler error:

I am getting a "incompatible types" error. Thanks for any help!

Rajeev Trikha wrote:Sean, whenever your Comparator is invoked it is going to reverse the collection because of the line return b.compareTo(a) If ascending order is required then a.compareTo(b) will be used.



Thanks, for clarifying that.

Henry Wong wrote:

Sean Lim wrote:
How does the compare() method determine which strings it uses as a, and as b?



It doesn't. It is the sorting algorithm that determines which elements that it needs to compare -- and that is algorithm dependent.

Henry



Thanks Henry, but which algorithm is it using in the code posted? All I see is that it's using the Array's sort method and that it would be in natural order? But because it flipped the arguments it is actually in reverse natural order, as far as I can tell.

Thanks Anbarasu for pointing that out.
Hi guys,

In chapter 7 form K&B's SCJP book there is a piece of code which I had a question on.


How does the compare() method determine which strings it uses as a, and as b?
Guys, the link isn't working for me. http://www.sun.com/training/savings/retake.xml Anybody know if this offer still stands? I am very interested in it. Thanks!
Thanks for the explanation! This helped me understand it myself.