Created
October 7, 2020 19:52
-
-
Save LionelBeato/a9c51df639e66ea1f13062908f46c667 to your computer and use it in GitHub Desktop.
Scanner example and LocalDate example
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.time.LocalDate; | |
import java.util.*; | |
//import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// how to make the scanner object | |
Scanner scan = new Scanner(System.in); | |
// reading input from the scanner | |
System.out.println("Input a word:"); | |
String x = scan.nextLine(); | |
// output our read information | |
System.out.println(x); | |
scan.close(); | |
// time package overview | |
LocalDate today = LocalDate.now(); | |
System.out.println(today); | |
LocalDate dateOfBirth = LocalDate.of(1990, 8, 16); | |
System.out.println(dateOfBirth); | |
// TODO ask for name, birthday, and print them to the console | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment