Verified Commit 0c07cb97 authored by Jonas Sulzer's avatar Jonas Sulzer 馃帗
Browse files

馃憣 IMPROVE: add comments explaining errors



Signed-off-by: Jonas Sulzer's avatarJonas Sulzer <jonas@violoncello.ch>
parent 02de5d24
......@@ -5,12 +5,12 @@ class AbstractFinal {
A[] tab = new A[3];
tab[0] = new A();
tab[0] = new A(); // abstract class can't be initialized
tab[1] = new B();
tab[2] = new C();
tab[1].b = 2;
((C)tab[2]).c = 3;
tab[1].b = 2; // tab is of type A, so b can't be accessed as it's not defined in A
((C)tab[2]).c = 3; // final can't be modified
}
}
......@@ -35,7 +35,7 @@ abstract class D extends A {
abstract int calcul(int b) {
}
} // abstract class can't have content
abstract int machin();
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment