253,861 views
25 votes
25 votes
Ask the user to input a country name. Display the output the message "I would love to go to [country]"

User Dickson
by
2.7k points

1 Answer

16 votes
16 votes

Answer:

import java.util.Scanner;

public class Country{

public static void main (String[] args){

Scanner input = new Scanner(System.in);

System.out.print("Input a country name: ");

String country = input.nextLine();

System.out.println("I would love to go to " + country);

}

}

Step-by-step explanation:

User Jeff Schuman
by
2.5k points