0

What happens when you call methodOfA() in the below class?

class A { int methodOfA() { return (true ? null : 0); } }

18th Feb 2017, 3:41 AM
Kartikeya Bhardwaj
Kartikeya Bhardwaj - avatar
3 Answers
0
This will cause an unckecked exception in Java: NullPointerException.
18th Feb 2017, 4:33 AM
Jian-hua Yeh
Jian-hua Yeh - avatar
0
7th Oct 2021, 9:03 AM
Vimlesh Kumar Singh
Vimlesh Kumar Singh - avatar
0
7th Oct 2021, 9:03 AM
Vimlesh Kumar Singh
Vimlesh Kumar Singh - avatar