具有类名的变量

时间:2019-04-28 17:08:03

标签: c# linked-list nodes

有人可以向我解释这一行代码吗?

public class Node {

// in the below line what is next and why the class name("node") is used 
//with it
public Node next;
//what is object here and what is data
public Object data;
}

1 个答案:

答案 0 :(得分:1)

Object是.net System.Object类型

public Node nexy只是声明一个与您所在类(Node类)类型相同的变量。