This one actually comes from their own youtube channel. In this short video from their series “Cracking the Java Coding Interview“, the host explains that “the ConcurrentModificationException that you get has in fact nothing to do with concurrency.”
Continue reading “Misnomer: ConcurrentModificationException”Category: Java Misnomers
These posts are about confusing names and keywords in Java. I use Java a lot and I know many of the terms that cause a lot of confusion. I try to explain why the term was used and what better alternatives would exist.
Misnomer: java.nio.charset.Charset
A charset is not an encoding.
We also have StandardCharsets. It’s great to have a class with these constants. But UTF-8, UTF-16BE and UTF-16LE are all the same set of charaters: Unicode
Misnomer: static Keyword
The keyword “static” is arguably a bad choice of naming.
If you look up “static” in a dictionary you find many meanings, none of which explains its use in programming languages. So why is it used in Java, and how is it misunderstood?
Continue reading “Misnomer: static Keyword”Misnomer: Cloneable
In my category for Java Misnomers I really should write about this silly interface.
Continue reading “Misnomer: Cloneable”Misnomer: String.length()
The method String.length() gives the length of the String, right? Or does it?
Misnomer: @FunctionalInterface
So it’s functional, right? Then why isn’t it a function? I’ll try to explain.
Continue reading “Misnomer: @FunctionalInterface”
Misnomer: The class named Class
So there’s a class named Class. But it represents interfaces, annotations and enums too. What’s up with that?
Continue reading “Misnomer: The class named Class”
Misnomer: List Interface
Some think “List” is a misnomer. I don’t even mind so much. I think List is ok.
I just put this here because there already is an entry in the FAQ:
PS: Vector is strange, though. It is synchronized and it really should be SynchronizedList. But it is defacto deprecated. So who cares?
Misnomer: RuntimeException
So a RuntimeException is thrown at runtime, right?
Continue reading “Misnomer: RuntimeException”
Misnomer: NullPointerException
Java does not have pointers. Variables are of primitive or reference type. So it uses references. Then why is there a NullPointerException?