基礎型別(Primitives)靜態工具


package org.wisdomfish.primitive;

import com.google.common.primitives.Ints;
/**
*
* @author ChaoYi
*/
public class PrimitiveDemo {

public static void main(String[] args) {
int a = 5;
int b = 10;
int compareTo = Integer.valueOf(a).compareTo(Integer.valueOf(b));

int compare = Ints.compare(a, b);

}
}



import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
import java.util.List;
        List<Integer> list = Lists.newArrayList(1,2,3,4,5);
        int[] i = Ints.toArray(list);



Comments