I am implementing stack in java. While doing this I saw a code where a function returns -1. Like this one:
public int peek()
{
if (!isEmpty())
return arr[top];
else
System.exit(1);
return -1;
}
What does it actually mean returning a -1 value?