VC中自定义结构体,如下:
typedef struct _listElement {               
    char type;                              
    int start;                              
    int end;                                
} listElement, *pListElement;
typedef struct _arrayList {                 
    pListElement array;                     
    int size;                               
    int capacity;                           
} arrayList, *pArrayList;
函数如下:
pListElement listGet(pArrayList list, int idx) {                   
    if (idx >= list->size || idx < 0)
        return NULL;
    return list->array + idx;
}这里参数list是结构体指针,返回值类型也为结构体指针。
在java中该如何实现呢??
(我想这个结构体大概可以用类模拟,但是结构体arrayList中的成员pListElement array; 我又该怎么办呢?哎呀,一塌糊涂!!)
请大家指点!谢谢!