I was trying to return value true or false depending upon the condition by using a conditional operator but I got an error. Here is my code,
bool isEmpty() {
The ternary operator (?:) is not designed to be used like that. You have a syntax error.
?:
Try this instead:
return (listSize > 0);