Create Basic Java Algorithm