示例#1
0
 public String GetInfoFirstItem()
 {
     if (first != null)
     {
         return(first.getItem().ToString());
     }
     else
     {
         return("there is no first item in the list");;
     }
 }
示例#2
0
 public String GetInfoThirdItem()
 {
     if (first != null)
     {
         Node second = first.getNext();
         if (second != null)
         {
             Node third = second.getNext();
             if (third != null)
             {
                 return(third.getItem().ToString());
             }
             else
             {
                 return("there is no third item in the list");;
             }
         }
         else
         {
             return("there is no third item in the list");;
         }
     }
     else
     {
         return("there is no third item in the list");;
     }
 }