Archive for May, 2008
Unboxing as a Java Interview Question
7 Comments Published May 14th, 2008 in Exception, Interview, Java, QuestionSometimes I ask an unboxing question during Java interviews. “What can happen with unboxing? See this code:”
Integer i1;
…
// do some things with i1;
…
int i2 = i1;
The thing that can happen is that i1 is NULL which will result in a NullPointerException being thrown.
“What is the problem with the NPE here?” There are several […]
Akismet has protected your site from 100,152 spam comments.
0 Comments Published May 9th, 2008 in Akismet, Spam, WordpressThe title says it all. Thanks.
var dzone_style=”2″;
Bending Java: More readable code with methods that do nothing?
12 Comments Published May 9th, 2008 in Beautiful Java, Bending Java near the Breaking Point, JavaFrom the category “Bending Java near it’s Breaking Point” or “What a stupid but interesting idea”. I like to explore ideas in Java that are inside the language spec but outside of common usage or style guides. I think Java has a lot more to give than what people did the last ten years. Before […]
After my 200 reader milestone in January, we’ve reached the 300 (317) reader milestone. Thanks to all the regular readers of this blog for listening. I know 300 is still not as many readers as others have, and it might drop below 300 the next day, but I’m still thankful for everyone of you (including […]
I’m working on a paper on Open Sourcing and - though I have quite some knowledge on the topic - cannot find a lot of relevant papers, posts or articles. Most hits are about open source not open sourcing and “open sourcing” doesn’t find relevant things. Any ideas? Any papers? Any links? Thanks :-)
var dzone_style=”2″;
Never, never, never use String in Java (or at least less often :-)
74 Comments Published May 2nd, 2008 in JavaNever, never, never use (unwrapped) String or long or int. Why? Those primitive types have no semantic meaning. They are hard to understand, hard to maintain, and hard to extend. I’ve been evangelizing this concept for some time, the essay “Object calisthenics” finally prompted be to write this post. Suppose we have an example of […]