I want to know that I want to print string one after another but in a particular time interval.
Everything is fine.
I want to know that when second string print override the first one and third override the second and so on..
How can I do this?
This is my code :
public class StringTest {
public static void main(String args[]) {
String arr[] = { "mahtab", "hussain", "yasir", "azmi", "saif" };
int l = arr.length;
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i]);
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}