Skip to content

Instantly share code, notes, and snippets.

@PocasPedro
Created November 13, 2017 15:33
Show Gist options
  • Save PocasPedro/0bcae53a5c1502dc7c895600c620b17b to your computer and use it in GitHub Desktop.
Save PocasPedro/0bcae53a5c1502dc7c895600c620b17b to your computer and use it in GitHub Desktop.
Java Fundamentals for Kids - Exercise 24
import java.util.concurrent.TimeUnit;
/**
Program that shows my Full Name ... prints First name, pauses 2 seconds then prints Last name
*/
public class FullName {
public static void main(String[] args) {
String firstname = "Pedro";
String lastname = "Almeida";
System.out.println("My first name is " + firstname);
try{
TimeUnit.SECONDS.sleep(2);
} catch (InterruptedException e) {
System.out.println("Some Error");
}
// Prints the variable result of the second operation to the terminal window.
System.out.println("My last name is " + lastname);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment