我有一个班级
class Message
{
public String message, sender;
public Message (String msg, String from)
{
// check here that msg and from are not null. If so, use a default value or throw an NullPointerException
message = msg;
sender = from;
}
// Just a utility method for printing out the Message to System.out
public String toString () { return sender+":"+message; }
}
我在主要活动中定义
Hashtable<String, ArrayList<Message>> table = new Hashtable<String, ArrayList<Message>>();
我想将此表变量传递给另一个片段。我该怎么做?