What errors inside this file?

Computer Science
Tutor: None Selected Time limit: 1 Day

import java.util.Scanner;

public class DebugThree3

{

   public static void main(String args[])

   {

      String name;

      getName();

      displayGreeting(name);           

   }

   public static String getName()

   {

      String name;

      Scanner input = new Scanner(System.in);

      System.out.print(Enter name );

      name = input.nextInt();

      return name;

   }

   public static void displayGreeting()

   {

      System.out.println("Hello, " + name + "!");

   }

}

Oct 5th, 2015

Thank you for the opportunity to help you with your question!

Please look into below code

public static String getName()

   {

      String name;

      Scanner input = new Scanner(System.in);

      System.out.print(Enter name );

      name = input.nextInt();  // nextInt scan for numbers only should be nextLine.

      return name;

   }

If you have any questions please let me know

Regards.


Please let me know if you need any clarification. I'm always happy to answer your questions.
Oct 5th, 2015

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Oct 5th, 2015
...
Oct 5th, 2015
May 25th, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer