- 1

UserInput

Hello! Can somebody please tell me how i create a UserInput in Java just like in C#

27th Apr 2022, 2:57 PM
Keys
Keys - avatar
3 Respostas
+ 3
Keys import java.util.Scanner; // Import the Scanner class class Main { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); // Create a Scanner object System.out.println("Enter username"); String userName = myObj.nextLine(); // Read user input System.out.println("Username is: " + userName); // Output user input } }
27th Apr 2022, 3:05 PM
NonStop CODING
NonStop CODING - avatar
27th Apr 2022, 3:21 PM
Stefanoo
Stefanoo - avatar
0
Thank you very much
27th Apr 2022, 3:07 PM
Keys
Keys - avatar