java - Double class vs double primitive data type -


I have learned to see other references; So that there are many disadvantages in double .

Double loss compared to double primitive data types:

  1. It is slow (reference :)
  2. More storage due to metadata associated with it Takes.

    Now, I know that there are some manipulations that we can do with double but most of these methods (85%) are static, before any big There is no profit. One more thing I know is that the double can not be zero.

      Double double class = zero; // valid double double type = zero; // Results in NPE   

    After all these losses I do not understand why we will not use double in real life scenario and will not double. Some can give examples of a real world and can explain.

    Thanks

    There are several main reasons that you should use double

  3. In some cases you know that different data sources You can use the class. Note in most cases

      double D1, D2; // in some value D1 == D2;  

  4. As you mentioned it

    double tap Can not be double and Think of a situation where some object may be worth or if it is not so, we want it to be cleaned in the database, it will be thrown in double form, but this will not happen with double.

    You should use the primitive type whenever possible and do not double.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -