Java Math BigInteger.getLowestSetBit() 方法 Java Math BigInteger.gcd() 方法 Java Math BigInteger.hashCode() 方法 Java Math BigInteger.getLowestSetBit() 方法 package com.codingdict; import java.math.*; public class BigIntegerDemo { public static void main(String[] args) { // create 2 BigInteger objects BigInteger bi1, bi2; // create 2 int objects int i1, i2; // assign values to bi1, bi2 bi1 = new BigInteger("8");//1000 bi2 = new BigInteger("7");//0111 // perform getLowestSetBit on bi1, bi2 i1 = bi1.getLowestSetBit(); i2 = bi2.getLowestSetBit(); String str1 = "Index of rightmost one bit in " +bi1+ " is " +i1; String str2 = "Index of rightmost one bit in " +bi2+ " is " +i2; // print i1, i2 values System.out.println( str1 ); System.out.println( str2 ); } } Java Math BigInteger.gcd() 方法 Java Math BigInteger.hashCode() 方法