Java Find the greatest common divisor of two positive integers

www.lautt‮c.iru‬om
Java Find the greatest common divisor of two positive integers

compute gcd in Java

/**
 * @author lautturi.com 
 * Java example: compute gcd of two integers in Java
 */

import java.util.*;
import static java.math.Blautturinteger.valueOf;
import java.math.Blautturinteger;

public class Lautturi {

	public static void main(String[] args) {
		int x = 24;
		int y = 32;
		int  result = valueOf(x).gcd(valueOf(y)).intValue();
		System.out.println(result);
	}

}

output:

8
Created Time:2017-09-23 15:46:57  Author:lautturi