MissouriTiger
Programmer
I would sure appreciate some assistance. Could someone please explain what I'm doing wrong and the correct way to do this?
I have a user class, whose main() method requires 4 arguments. I'm trying to have another class instantiate the user class. But the code won't compile. Their is something about the syntax I don't understand.
Here is the code for my user class main methiod:
public static void main(String uName, String pWord, String fName, String lName)
{
setUsername(uName);
setPassword(pWord);
setFirstName(fName);
setLastName(lName);
}
Here's the method to instantiate:
public MessageSystemUser newSystemUser(
String userName,
String password,
String firstName,
String lastName)
{
return IMUser user = new IMUser(userName, password, firstName, lastName);
}
What is the correct way to do this? If necessary I can post or email the whole classes, they're pretty simple.
I have a user class, whose main() method requires 4 arguments. I'm trying to have another class instantiate the user class. But the code won't compile. Their is something about the syntax I don't understand.
Here is the code for my user class main methiod:
public static void main(String uName, String pWord, String fName, String lName)
{
setUsername(uName);
setPassword(pWord);
setFirstName(fName);
setLastName(lName);
}
Here's the method to instantiate:
public MessageSystemUser newSystemUser(
String userName,
String password,
String firstName,
String lastName)
{
return IMUser user = new IMUser(userName, password, firstName, lastName);
}
What is the correct way to do this? If necessary I can post or email the whole classes, they're pretty simple.