Click here to Skip to main content
14,920,659 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone, I'm trying to make a program where a user types in their full name(first and last) on the main method, then the program will print on the method named Display_Info, together with the name. But it doesn't work and I have no idea why?

What I have tried:

public class AccountGenerator {

    public static void main(String[] args) {

        Scanner input = new Scanner(;

        String name = input.nextLine();
        System.out.println("Please enter employee's first and last name: " + name);


    public static void Display_Info(String name, String username, String email) {

        System.out.println("Employee Details");

        System.out.println("Name        : " + name); 
        System.out.println("Username    : " + username);
        System.out.println("Email       : " + email);

Updated 8-Feb-21 9:17am

1 solution

Sorry, Everyone, I found the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900