0
如何在If语句中比较两个LongWritable ???像,在if语句中比较两个LongWritable
if(compareTo(key1,new LongWritable(1))
{
//do something;
}
如何在If语句中比较两个LongWritable ???像,在if语句中比较两个LongWritable
if(compareTo(key1,new LongWritable(1))
{
//do something;
}
LongWritable实现可比所以使用compareTo方法:
if (lw1.compareTo(lw2) == 0) {
// lw1 has same value as lw2
}
它工作得很好...日Thnx – Divyendra 2013-04-23 18:29:07