Friday, 15 July 2011

java - Why doesn't Number use Comparable/Comparator -


Brief questions;

I have read Jawadox for comparative and comparative and I do not understand the difference Comparative throws a NullPointerException and has been implemented by comparative multiple classes, so its methods are more readily available, are they the only difference?

Why does the second part of my question implement a consistent number, but something like BigDecimal does? It appears that only nuclear integers and nuclear line numbers do not implement comparisons with the class. Why is this so? Why not 'nuclear' classes are compatible?

Long questions;

I ask because of this because I am trying to convert a life-force to an object (likely to be a boolean, string or number) for easy performance and a switch on the return To do this, it compares the number one person to each operator to determine how I want to use relational operators.

My test has shown that non-preferences can not be compared, unless you're using comparative comparison ().

I have to try to change the number to less generic, which requires me, but I was thinking of going overflow and memory usage to go wild but I know that the floating point is the exact problems stack overflow How can more experienced members handle this problem?

when a class is comparable to execute, then only makes a comparison) method. You can not define two or more compareTo () methods in a class. What if you want to compare some other values? Then you can apply new classes with the comparator interface to use with other values. Comparative interface comes to help in such a case.

Number is an abstract class - there is nothing to compare to

This class has been enhanced by integral, double, etc. like the comparison of the classics. There are solid values.

How to use both of the interfaces here:


No comments:

Post a Comment