How to capture user input in JAVA | Scanner Object Tutorial

Publicado el: 25 diciembre 2023
en el canal de: Bakr Kode
48
4

This video shows you how to get user input and output it to the console within Java! Below is the source code for reference! If you have any questions, leave a comment and I'll get back to you!

// ---------------- SOURCE CODE ----------------- //

import java.util.Scanner;

public class UserInput {

public static void main(String[] args) {

// Create Scanner Object
Scanner scannerObject = new Scanner(System.in);

// Asking user for their user name
System.out.println("Enter name:" );

// Holding user's input
String userName = scannerObject.nextLine();

// Outputting user's name
System.out.println("Your name is " + userName);

}
}

TAGS
#Programming #Coding #Tutorial #ScannerObject #JavaTutorial #Java #backend #softwareengineer


En esta página del sitio puede ver el video en línea How to capture user input in JAVA | Scanner Object Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario Bakr Kode 25 diciembre 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 48 veces y le gustó 4 a los espectadores. Disfruta viendo!