《Java ME手机应用开发大全》源码
書籍內容簡介:
http://www.china-pub.com/410
源代码在线查看: message.java
//定义代表发送的消息类
public class Message
{
//定义收件人字段
private String to;
//定义邮件主题字段
private String subject;
//定义邮件内容字段
private String content;
//默认构造函数
public Message()
{
}
//带参数的构造函数
public Message(String to, String subject, String content)
{
this.to = to;
this.subject = subject;
this.content = content;
}
//属性字段的get和set方法
public String getContent()
{
return content;
}
public void setContent(String content)
{
this.content = content;
}
public String getSubject()
{
return subject;
}
public void setSubject(String subject)
{
this.subject = subject;
}
public String getTo()
{
return to;
}
public void setTo(String to)
{
this.to = to;
}
public String toString()
{
return to+subject+content;
}
}