Hi all! Even being (at the time of creating this post) at level 8, I have already found interesting applications for basic methods in Java. In 2 minutes I wrote a program simulating a person writing with errors. There is absolutely nothing complicated in the code; any beginner will understand what’s what:
import java.util.Random;
public class ThreadSleep {
public static void main (String[] args) throws InterruptedException{
String text = "Hello my frend\b\b\biend! Welcome to MAtr\b\bTRIX!";
Random newRandom = new Random();
for (char var: text.toCharArray()) {
System.out.print(var);
Thread.sleep(newRandom.nextInt(500));
}
}
}
I believe that interesting challenges are part of a person's motivation to move on. The question is: are there people here who have created a short code just to “play around” using methods that a beginner can easily master? If yes, leave it in the comments. Just the conditions of the task are also welcome!
GO TO FULL VERSION