Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 If 语句中比较两个 LongWritable ??? 喜欢,
if(compareTo(key1,new LongWritable(1)) { //do something; }
LongWritable 实现 Comparable 所以使用 compareTo 方法:
if (lw1.compareTo(lw2) == 0) { // lw1 has same value as lw2 }