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: java.nio.charset.Charset
A charset is not an encoding.
Computer Programming for Humanoids
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.
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
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”In my category for Java Misnomers I really should write about this silly interface.
Continue reading “Misnomer: Cloneable”The method String.length()
gives the length of the String, right? Or does it?
So it’s functional, right? Then why isn’t it a function? I’ll try to explain.
Continue reading “Misnomer: @FunctionalInterface”
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”
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?
So a RuntimeException
is thrown at runtime, right?
Continue reading “Misnomer: RuntimeException”
Java does not have pointers. Variables are of primitive or reference type. So it uses references. Then why is there a NullPointerException?
The final keyword creates a lot of confusion in the Java world. I’ll try to clear things up a bit. Continue reading “Misnomer: final keyword”