When I compile my code, I’ve this error message : “error: constructor AcceptedFriendAction in class AcceptedFriendAction cannot be applied to given types;” at line 23 ( AcceptedFriendAction action […] )
I read that because I have a String in my constructor, but I don’t realy understand how arrange this. If anyone can help me ? Thank you for your time and your comprehension.
public class AcceptedFriendAction extends SocialAction {
private static final long serialVersionUID = -692737;
@ManyToOne
private User newFriend;
public AcceptedFriendAction(final SocialInterest socialInterest,
final DateTime date, final String suggestComment, final User newFriend) {
super(socialInterest, date, suggestComment);
this.newFriend = newFriend;
}
public User getNewFriend() {
return newFriend;
}
public static AcceptedFriendAction add(final SocialInterest socialInterest,
final String suggestComment, final User newFriend) {
AcceptedFriendAction action = new AcceptedFriendAction(socialInterest, new DateTime(), newFriend, suggestComment);
action.save();
return action;
}
}
thank you again 🙂
You have misplaced 3rd and 4th parameters
Code should look like: