The Artima Developer Community
Articles | News | Weblogs | Books | Forums
Sponsored Link

Artima Weblogs
Doing Things with Java that Should Not Be Possible
A Weblog by Heinz Kabutz
Welcome Guest
  Sign In
1 page [ 1 ]
February 14, 2012,  1 comment
What is the largest double that could in theory be produced by Math.random()? In this newsletter, we look at ways to calculate this based on the 48-bit random generator available in standard Java. We also prove why in a single-threaded program, (int)(Random.nextDouble() + 1) can never be rounded up to 2.
December 22, 2011,  57 comments
A couple of weeks ago, I sent out a little quiz to my readers of The Java Specialists' Newsletter. No one managed to figure out what the code does without running it. Some managed to explain the result once they had run it. Perfect quiz for weeding out those job applicants you don't like. Especially in the banking industry. Enough hints :-)
March 15, 2006,  Submit comment
In the latest Java Specialists' Newsletter, we debate why you should write generics code such as class TaxPayer<P extends TaxPayer<P>>. Is it necessary, or would class TaxPayer<P extends TaxPayer> have been sufficient?
May 11, 2005,  4 comments
The Object Adapter Design Pattern is often used for modifying an interface into another interface that the client expects. A drawback with this pattern is that you need to implement all the methods of the target interface. In this newsletter, solve the problem with dynamice proxies
October 12, 2004,  1 comment
There is a serious error in the JDK 1.5 compiler, pointed out to me by one of my readers, Amotz Anner. Using final local variables in conjunction with ternary if-else where one side of the values is null, leads to incorrect results.
July 29, 2004,  1 comment
There is absolutely nothing you can do with a deadlocked thread. You cannot stop it, you cannot interrupt it, you cannot tell it to stop trying to get a lock, and you also cannot tell it to let go of the locks that it owns. In this BLOG, Heinz shows a method in JDK 1.5 how you can be notified whenever a thread becomes deadlocked.
July 15, 2003,  1 comment
Let us walk down memory lane together as we look at the pre-cursor to Java, a language called Oak, developed by Sun Microsystems for use on their handheld device. The will answer many old questions: Why are there no enums in Java? Why does the protected modifier allow package access? What is an asynchronous exception?
May 21, 2003,  24 comments
Java Strings are strange animals. They are all kept in one pen, especially the constant strings. This can lead to bizarre behaviour when we intentionally modify the innards of the constant strings through reflection. Join us, as we take apart one of Java's most prolific beasts.
1 page [ 1 ]
Subscribe to be notified of new weblog posts by Heinz Kabutz via RSS.

Sponsored Links


Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use