I noticed a lot of the repls in repl.it are in python and a lot of the console programs are in python(because it is the most popular). A lot of them use slow print. So this tutorial teaches you how to slow print(print 1 char, wait, then write another char) in java.
My Code:
public class Main{
public static void main(String[] args){
slowPrint(50, "THIS WILL BE PRINTED CHAR BY CHAR");
}
public void slowPrint(int time, String toPrint){
char[] toPrintC = toPrint.toCharArray();// Create a char array and assign that to a string converted to a char array
for(int i = 0; i < toPrintC.length;i++){ // Create a for loop
System.out.print(toPrintC[i]);// Print the char
try{
Thread.sleep(time);// Stop printing for the amount of milliseconds specified(in the variable time)
}catch(Exception e){
e.printStckTrace();
}
// We surround in try/catch because Thread.sleep throws an exception
}
}
}
@Highwayman, yes, unfortunately it does. Good news is, I just finished the java OOP tutorial! I will post it now. (Remember how you asked why you should hide your data)
I noticed a lot of the repls in repl.it are in python and a lot of the console programs are in python(because it is the most popular). A lot of them use slow print. So this tutorial teaches you how to slow print(print 1 char, wait, then write another char) in java.
My Code:
Hope this helps!
@Highwayman, yes, unfortunately it does. Good news is, I just finished the java OOP tutorial! I will post it now. (Remember how you asked why you should hide your data)