1.It has been given that Math class being an option for immutable classes is a trap. I know Math class cannot be extended nor can it be instantiated. What do you mean by immutable classes?
I think it is important to differentiate between immutable classes and immutable objects. Math is a final class so it cannot be extended and behavior of any of it's functions cannot be overriden. String objects are immutable (String class is also final). The reason Math cannot be instantiated is because it does not provide any public constructors.
2. instanceOf is different from instanceof
instanceof is a keyword and instanceOf is not. In
java no keyword contains a capital letter.
Hope that was of help.
Regards,
Abhijit