0
Why when using instanceof in java to a null variable the output would be flase
2 Answers
+ 2
instanceof will return true if the value/value of a variable being tested is of the type being compared to
keep in mind that you never test variable but actually value inside a variable
consider the following:
boolean a = "Coder" instanceof String;//returns true
boolean b = null instanceof String;)//returns false
0
Thank you
This helped alot