Please explain why the code throws a NullPointerException.
Output:/opt/tools/java/jdk1.7.0_65/bin/java com.mrbear.autoboxing.Plot
0
3
3
Exception in thread "main" java.lang.NullPointerException
at com.mrbear.autoboxing.Plot.getSurfaceArea(Plot.java:28)
at com.mrbear.autoboxing.Plot.main(Plot.java:39)
Process finished with exit code 1
Also, please mention how to fix it.0
3
3
Exception in thread "main" java.lang.NullPointerException
at com.mrbear.autoboxing.Plot.getSurfaceArea(Plot.java:28)
at com.mrbear.autoboxing.Plot.main(Plot.java:39)
Process finished with exit code 1
((Solution))
No comments:
Post a Comment