codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  java problem  happygirl at 02:24 on Tuesday, March 21, 2006
 

i create the Queue program below and i facing problem with the SLLNode , it can't resolve the sysmbol. Can you all help me fix it ? Thanks !

public class Queue
{
private SLLNode front, rear;

public Queue () {
front = rear = null;
}

public int size ()
{
int lenght = 0;
for (SLLNode curr = front;
curr != null; curr = curr.succ)
lenght++;
return length;
}


public boolean isEmpty()
{
return (front ==null);
}

public void clear() {
front = rear = null;
}

public Object getFirst () {
if (front == null) throw new ClassCastException("There is no object in Queue.");
return front.element;
}



public void addlast (Object elem){
SLLNode newnode = new SLLNode(elem, null);
if (rear != null) rear.succ = newnode;
else front = newnode;
rear = newnode;
}

public Object removeFirst () {
if (front == null) throw new ClassCastException("There is no object in Queue.");
Object frontElem = front.element;
front = front.succ;
if (front == null)
rear = null;
return frontElem;
}
}









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007