ive created a java program that the user enters their name and the program will then print out hello (whatever their name is) and goodbye (whatever their name is). the code i have shown create a program that allows for user input but it will not add the users name after hello or goodbye.
any help is appreciated.
indents are correct in my program
import java.util.Scanner; public class HelloGoodbye { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter your name : "); String name = in.nextLine(); hello(name); goodbye(name); } static void hello(String name) { System.out.println("Hello" + name); } static void goodbye(String name) { System.out.println("Goodbye" + name); } }
Screen Shot 2018-11-09 at 22.17.19.png