tag:blogger.com,1999:blog-7817341111091650088.post5894564799474364503..comments2023-03-23T18:33:13.030+05:30Comments on The <Geek/> Head: Hidden features of JavaAbhishek Kapoorhttp://www.blogger.com/profile/03835589439238590389noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7817341111091650088.post-14758931180440214562009-06-26T15:32:02.685+05:302009-06-26T15:32:02.685+05:30I would not ever recommend anyone use java.net.URL...I would not ever recommend anyone use java.net.URL. First, it requires an internet connection, because it does a DNS lookup, which means it is slooooow. Don't EVER try to put URLs into a Set, because a Set checks for duplicates using the equals method. It can take minutes per insert even with a fairly small Set. <br />Second, URL.equals can return false when it should intuitively return true,Munseyhttps://www.blogger.com/profile/17855874413022710463noreply@blogger.comtag:blogger.com,1999:blog-7817341111091650088.post-37880766239755812222009-06-26T12:59:47.234+05:302009-06-26T12:59:47.234+05:30Dear Reader,
There are my more hidden trick you c...Dear Reader,<br /><br />There are my more hidden trick you can do in java that I might not aware of. If you know any please share some via comment.<br />ThankAbhishek Kapoorhttps://www.blogger.com/profile/03835589439238590389noreply@blogger.comtag:blogger.com,1999:blog-7817341111091650088.post-88514052276674670932009-06-26T04:26:33.188+05:302009-06-26T04:26:33.188+05:30I hope you like DNS connections if you're goin...I hope you like DNS connections if you're going to use that equals method. One of the reasons you shouldn't use URL in a map.<br /><br />Also there are some hilariously bitter C# apologists bemoaning the lack of "using" in java, when "using" is just a method definition away, and more flexible to boot. If this was put in the java.lang, and the compiler implicitly Paulo Fariahttps://www.blogger.com/profile/02374231047153225371noreply@blogger.com