Created
November 13, 2017 15:33
-
-
Save PocasPedro/0bcae53a5c1502dc7c895600c620b17b to your computer and use it in GitHub Desktop.
Java Fundamentals for Kids - Exercise 24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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