A reader and author on Javalobby, after reading the Java top Ten most useless features, also lists the features of the Java language that no one uses in his mind, and we can also come here to review
Before, I read the "Java10 most useless feature" of Anthony Goubard on Javalobby. I agree with some of his options, but I think he ignores some of the key features that nobody uses. I limit myself to language level features (APIs are too large), and here are 4 other Java features that are not used.
1. Strict floating-point numbers
Maybe somewhere, the Java STRICTFP keyword is important to a programmer, but I haven't met him/her yet. If you know how to use STRICTFP, you are probably the top 5% Java programmers. If you don't know strictfp, you should look here and welcome to the top 5%. But it's basically necessary to make sure that your calculations are wrong on all platforms.
2. Local class
Java has 4 kinds of internal classes, of which 3 are widely used. Like static inner classes, named inner classes, and anonymous inner classes, you can also define named classes within a method, although this is rarely seen in reality.
public class TopLevelClass
{
public void someMethod()
{
class LocalClass
{
// Some fields and methods here.
}
LocalClass forLocalPeople = new LocalClass();
}
}
3. Eight literal quantity
Who will use the octal number now? Hexadecimal is more convenient for binary values. Worse, the octal literal, beginning with 0, is confusing:
int a = 60;
int b = 060;
System.out.println(a + b); // Prints 108.
4. Short Data type
You're using it? I don't believe it. Everyone uses int when he wants to use an integral type, even if they don't need a 32-bit range.