What does the following Java code do?
public Object function()
{
if(isEmpty())
return -999;
else
{
Object high;
high = q[front];
return high;
}
}
public Object function()
{
if(isEmpty())
return -999;
else
{
Object high;
high = q[front];
return high;
}
}A. Dequeue
B. Enqueue
C. Return the front element
D. Return the last element
Answer: Option C

Join The Discussion