⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 message.java

📁 易个message
💻 JAVA
字号:
/* * /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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -