Java - Programming Language
This course covers the basics of programming in Java. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Getting User Input

Lesson 9
Author : Mike Dane
Last Updated : October, 2017


Copy// import java.util.Scanner;
Scanner keyboardInput = new Scanner(;

System.out.print("Enter username: ");
String username = keyboardInput.nextLine(); // .nextDouble(), .nextInt()
System.out.println("Hello, " + username);