Compilation errors in two code examples in ExceptionClassSum
Posted: Thu Dec 15, 2016 1:21 pm
Hi,
there are compilation errors "non-static variable k cannot be referenced from a static context" in code examples in the points:
"4. java.lang.ArithmeticException extends java.lang.RuntimeException"
and
"6. java.lang.ExceptionInInitializerError extends java.lang.Error"
in http://enthuware.com/downloads/Exceptio ... ummary.pdf
In both cases the line "public class X { int k = 0; " should be changed to "public class X { static int k = 0; ".
there are compilation errors "non-static variable k cannot be referenced from a static context" in code examples in the points:
"4. java.lang.ArithmeticException extends java.lang.RuntimeException"
and
"6. java.lang.ExceptionInInitializerError extends java.lang.Error"
in http://enthuware.com/downloads/Exceptio ... ummary.pdf
In both cases the line "public class X { int k = 0; " should be changed to "public class X { static int k = 0; ".