Can you have a negative string length? If so, is it the same as null?
No; the length of a string is 0 (empty string, represented as ""
) or higher. And an empty string is not the same as null either (in Java it is not called a null string).
To better understand what null means in Java, you could check out these questions:
No, never.
length is unsigned number, it can't be negative.
the first question's answer negates the second question's legitimacy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With