74.9k views
4 votes
4.2.5 codehs text messages answer

1 Answer

5 votes

Answer:

public class TextMessage

{

private String message;

private String sender;

private String receiver;

public TextMessage(String from, String to, String theMessage)

{

sender = from;

receiver = to;

message = theMessage;

}

public String toString()

{

return sender + " texted " + receiver + ": " + message;

}

}

User Romes
by
4.1k points