我正在尝试将以下内容转换为java。我创建了一个学生类并使用LinkedList<Student> studentList.
如何在 java 中执行以下 4 件事来加入 StudentNode 和 Queue?
Student *studentPtr;
StudentNode *p;
1. p.student = studentPtr;
2. p.next = null;
Queue readyQueue;
3. readyQueue.head
4. readyQueue.tail
typedef struct{
int age;
}Student;
struct my_struct
{
Student student;
struct my_struct* next;
}StudentNode;
struct my_list
{
struct my_struct* head;
struct my_struct* tail;
}Queue;
谁能帮我将以下函数转换为java方法?
StudentNode *makeStudentNode(Student *stPtr)
{
StudentNode *p = (StudentNode *)malloc(sizeof(StudentNode));
p->student = stPtr;
p->next = NULL;
return p;
}