You can't call a method like that. It expects those argument datatypes, you cannot respecify them in the method call itself. Give it name, id and storename, not String name, ... instead.
public class Store
{
// instance variables
private String storeName;
private int total;
/**
* Constructor for objects of class Store
*/
public Store(String newStoreName)
{
storeName = newStoreName;
total = 0;
}
/**
* Register a member
*/
public void memberRegister(String newName, String newId, int newPinNumber)
{
String name = newName;
String id = newId;
int pinNumber = newPinNumber;
Member.welcomeMessage(String name, String id, String storeName);
}
}
And here is the welcomeMessage method which is in the member class:
The only direct way to do it with the code you have here is to instantiate a new member within the method memberRegister. I would assume that memberRegister should be doing something with Member anyway, so that may be a fine place to construct a new member.
Instantiating a Member object would depend on the constructors available.
Here's an example of instantiating a Member if it has a default constructor (no arguments)
Code:
public void memberRegister(String newName, String newId, int newPinNumber)
{
String name = newName;
String id = newId;
int pinNumber = newPinNumber;
Member member = new Member();
member.welcomeMessage(name, id, storeName);
}