Shreyas arya

Generation

generate functionThu, 09 Feb 2023

Print string "Shreyas" and wait for 10 seconds. The duration between all the 3 attempts doesn't exceed 10 seconds.

import java.util.*; import java.lang.*; import java.io.*; class Test { public static void main (String[] args) throws java.lang.Exception { // your code goes here long start = System.currentTimeMillis(); System.out.println("Start: " + start); while(true){ System.out.println("Shreyas"); if(System.currentTimeMillis() - start > 10000){ break; } } } }

Questions about programming?Chat with your personal AI assistant