Java

Input in Java

import java.util.Scanner; //import package.name.Class;  //Import a single class
class NewClass {
  public static void main(String[] args) {
    Scanner myObj = new Scanner(System.in);
    System.out.println("Enter your name: ");
    String Name1 = myObj.nextLine();
    System.out.println("Your name is: " + Name1);
  }
}

To learn more follows: Java Scanner