Created
June 30, 2015 04:39
-
-
Save dested/79c4e47fdb7150430937 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.io.*; | |
import java.util.*; | |
public class Names { | |
public static void main(String[] args) throws FileNotFoundException { | |
Scanner input = new Scanner(new File("names.txt")); | |
Scanner console = new Scanner(System.in); | |
String text = ""; | |
String nameInput = userInput(console); | |
System.out.println(nameInput); | |
} | |
public static String userInput(Scanner console) { | |
System.out.print("What name: "); | |
String nameInput = console.nextLine(); | |
System.out.println("Name: " + nameInput); | |
return nameInput; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment