Looking for an explanation on why and how as to when your creating a void method in the same class and want to use the parameters in other methods in main how you should go about doing that. For some reason I'm being asked to intialize my string variables to null but when I plug them into the method assign it says the my paramets that I'm passing will remain null after I call the method. Why is that? After I call the assign method why isn't Java changing the variables to whatever the user enters?
import java.util.Scanner;
public class test {
public static Scanner input = new Scanner(System.in);
public static void main(String[] args){
String Company = null;
String URL = null;
String Country = null;
int Employees = 0;
assign(Company,URL,Country,Employees);
System.out.print(Company, URL, Country, Employees);
}
public static void assign(String companyName, String webAddress, String country, int employees){
System.out.print("Enter the company's name: ");
companyName = input.nextLine();
System.out.print("Enter the web address: ");
webAddress = input.nextLine();
System.out.print("Enter the country: ");
country = input.nextLine();
System.out.print("Enter the number of employees: ");
employees = input.nextInt();
System.out.print(companyName);
}
}