Preston Z. answered 11/01/21
Recent Computer Science Grad
The error I see in the highlighted line is that you are calling on User's constructor which requires 2 String arguments, String firstName and String lastName. You are passing it "username" which is a 'User' Object not a string.
When you call User's constructor the first time in this line "User username = new User(firstName_of_user, lastName_of_user );", it generates a password in the format you're looking for based on this line "String password = firstName.charAt(0) + lastName + "@123";". Have you learned about Getters and Setters? It appears that you are attempting to print out the generated password for this user and a getter method inside of user would help you accomplish this. This is somewhat of speculation on my part since I do not know what the assignment is asking for.
I would be happy to work more with you on this project if you would like to schedule a tutoring session and if not I hope I have helped you in some way with my response :)
Nick W.
Should I add the code in public static to public User(String firstName. String lastName)11/01/21