Hii every one , how are you

last week i thought to create a circular linked list , because what we took at
college just simply and doubly , and after i looked for more information about
Linked list , i surprised there is "Circular linked list " and "Doubly Circular Linked list".

i tried to create "Circular linked list " , but am not sure if it is true ? can
any body check ,, emmm i was wondering if i can create it using java.util.link....? if that possible ,, how i can do that :rolleyes: ?


Java Code:
public class myCLinkedList 
    {
    // creat head CNode ,
    private CNode head  ;


    public myCLinkedList() 
    {
        head = null;
    }
    
    public void add(Object obj)
    {
        CNode curr = new CNode(obj);
            if(head==null)
                {
                    curr.setNext(head);
                    head = curr;
                }
           else
                {
                    curr.setNext(head.getNext());
                    head.setNext(curr) ;
                }
    }
    public Object delete()
    {
        if(head==null) 
        {
            return "empty list";
        }
        else
        {
            Object t = head.getNext().getData();
            head.setNext(head.getNext().getNext());
            return t;
        }

    }
    
    public void print()
    {
        CNode curr = head;
        while(curr!=null)
        {
            System.out.println(curr.getData());
            curr = curr.getNext();
        }
        System.out.println("");
    }

}

best regards