LCM of two numbers using Java Explanation