1import java.util.Scanner; // Import the Scanner class
2
3class Main {
4 public static void main(String[] args) {
5 Scanner myObj = new Scanner(System.in); // Create a Scanner object
6 System.out.println("Enter username");
7
8 String userName = myObj.nextLine(); // Read user input
9 System.out.println("Username is: " + userName); // Output user input
10 }
11}
12