protyped code-compare,less,equal,greater

Sidak convert this to java