message.java
来自「易个message」· Java 代码 · 共 72 行
JAVA
72 行
/* * /home/grant/Teaching/COMP213/New/Slides/Code/Message.java * * Created: Tue Oct 7 15:03:10 2008 * * copyright Grant Malcolm * * This source code may be freely used, modified, or distributed * provided due credit is given. * */// package Comp213.MessageBoard.V1;/** * This class represents messages for a simple Message Board server. * Messages consist of two strings: one representing the name of the poster; * the other being the text of the message. * * * @author <a href="mailto:grant@liverpool.ac.uk">Grant Malcolm</a> * @version 1.0 */public class Message { /** * The name of the poster who sent the message. * */ private final String sender; /** * The text of the message. * */ private final String text; /** * Creates a new <code>Message</code> instance with the given data. * * @param s the name of the poster * @param t the text of the message */ public Message(String s, String t) { sender = s; text = t; } /** * Return the name of the sender of the message. * * @return the name of the poster who sent the message */ public String getSender() { return sender; } /** * Return the text of the message. * * @return the text of the message */ public String getText() { return text; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?