Answers for "java how to put scanner input inside method that takes object class"

8

how to use scanner class in java

// import Scanner
import java.util.Scanner;

// Initialize Scanner
Scanner input = new Scanner(System.in);

// Test program with Scanner
System.out.println("What is your name?");
String name = input.nextLine();

System.out.println("Hello," + name + " , it is nice to meet you!");
Posted by: Guest on November-04-2020

Code answers related to "java how to put scanner input inside method that takes object class"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language