1
Why is it not possible in Java to use the negation operator on an object like Javascript? Is this because Java is strongly typed or is there some other peculiarity? For in Javascript the negation operator can be applied in any type.
Example:
Java
String nome = "Renan";
if(!nome){ // erro
} ...
Javascript
let nome = "Renan";
if(!nome)
alert("Sem erro");
else
alert(nome);
Take a look here and here
– hkotsubo