java class timer example Example 1: java timer import java.util.Timer; Example 2: java timer Timer timer = new Timer();