+ 1
What happens when you call methodOfA() in the below class?
class A { int methodOfA() { return (true ? null : 0); } }
2 odpowiedzi
+ 2
You'll get a nullPointerException. The methods return type is int but, return (true ? null : 0) will always return null which is an incompatible type with int.