public class PersistentAnimation implements Serializable, Runnable
{
private Thread animator;
private int animationSpeed;
public PersistentAnimation(int animationSpeed)
{
this.animationSpeed = animationSpeed;
animator = new Thread(this);
}
public void run()
{
while(true)
{
// do animation here
}
這裏的動畫器沒有標記爲瞬態?它會繼續嗎?如果我不在java中將非序列化字段標記爲transient,會發生什麼情況?