P429: Added Java solution.