有好心人帮我解释一下每行代码的含义吗,谢谢!
class Element
{
public int value;
public Element next;
}
public class Program {
public static void main(String[] args) {
Element start=new Element();
start.value=22;
Element end=start;
Element temp=start;
end.next=null;
temp=new Element();
temp.value=45;
end.next=temp;
end=end.next;
end.next=null;
//printing, simple way
System.out.println(start.value);
System.out.println(start.next.value);
//printing, universal way
for (temp = start; temp != null; temp = temp.next) {
System.out.println(temp.value);
}
}
}