Basic OTP (Java)

import java.util.*; class TimeOutTask extends TimerTask { boolean isTimedOut = false; public void run() { isTimedOut = true; } } class BasicOTP { public static void main(String args[]) { Random r = new Random(); String otp = new String(); for(int i=0 ; i<8 ; i++) { otp += r.nextInt(10); } System.out.println(otp); TimeOutTask task = new TimeOutTask(); Timer t = new Timer(); t.schedule(task, 10000L); ClientThread c … Continue reading Basic OTP (Java)