Write the header and body for isEmpty. The method returns true if the list is empty and false otherwise. Does the method need to know if the underlying implementation uses an array or a list structure?

What will be an ideal response?

isEmpty can be determined from a call to size, and does not need to know how the list is implemented. Here are two
possible solutions:
```
public boolean isEmpty()
{
if (size() == 0)
return true;
else
return false;

}
```
```
public boolean isEmpty()
{
return (size() == 0);
}
```

Computer Science & Information Technology

You might also like to view...

Trainers mostly speak at a loud volume

Indicate whether the statement is true or false

Computer Science & Information Technology

Many RFID (radio-frequency identification) and NFC (near field communication) tags contain no power source of their own and depend on the receiving device to provide the power for data exchange.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology