Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Joop Eggen
ArrayList Declaration vs Conversion
Both do the same thing. But the difference is that the first makes it more readable. You would exactly know that you're adding weatherforecast information to a list. In the second case you just keep on adding information, using add(), this actually looks a bit clumsy than the other.
Why should Java 8's Optional not be used in arguments
I've read on many Web sites Optional should be used as a return type only, and not used in method arguments. I'm struggling to find a logical reason why. For example I have a piece of logic which has 2 optional parameters. Therefore I think it would make sense to write my method signature like this (solution 1): Many web pages specify Optional should not be used as method arguments.
How to cleanly and quickly escape from recursion in Java
Is there a way to cleanly escape from recursion in Java? There is a way to break out from a by using the statement. Is there an equivalent pattern or method of escaping a recursion? I can think of spawning a separate thread, and once the value is computed, simply killing a thread rather than bubbling up the recursion stack. Is there a better way? There is already a question that discusses how you can break out of recursion: here.
Nice way to force user fill varargs parameter in Java
I want to force user to fill optional parameter in constructor: public MyClass(String... params) { this.params = params; } For now, next code is valid: new MyClass(); I want to prevent it. I thought of this: public MyClass(String param1, String... otherParams) { this.params = new String[1 + otherParams.length]; this.params[0] = param1; // fill 1..N params from otherParams } Sure String[] params is not an option, I need the ability to use comma separated args.
Do Java 8 default methods break source compatibility?
It has generally been the case the Java source code has been forward compatible. Until Java 8, as far as I know, both compiled classes and source have been forward compatible with later JDK/JVM releases. [Update: this is not correct, see comments re 'enum', etc, below.] However, with the addition of default methods in Java 8 this appears to no longer be the case. For example, a library I have been using has an implementation of which includes a .
Why is a static method considered a method?
I'm writing an explanation for some code for a course, and have been accidentally using the words "method" and "function" interchangeably. I decided to go back over and fix the wording, but ran into a hole in my understanding.
Is there a way to have a Java8 duration of one year that accounts for leap years?
I need the number of days in a year and I wanted to use Java8's new time api. However, I can't do because it doesn't account for leap years. And doesn't fly because of java.time.temporal.UnsupportedTemporalTypeException: Unit must not have an estimated duration I looked into Period, but it doesn't appear useful for going from years to days. I feel like I'm missing something here?
Why do we have to use divs?
This morning, as I was writing some html and haml, it occurred to me that the way divs are used is ridiculous. Why are divs not implied?
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Joop
Contact Joop, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack