Verified Commit 02de5d24 authored by Jonas Sulzer's avatar Jonas Sulzer 馃帗
Browse files

馃摝 NEW: add AbstractFinal.java as provided in exercice



Signed-off-by: Jonas Sulzer's avatarJonas Sulzer <jonas@violoncello.ch>
parent be13dcbd
package Ex_05;
class AbstractFinal {
public static void main(String[] args) {
A[] tab = new A[3];
tab[0] = new A();
tab[1] = new B();
tab[2] = new C();
tab[1].b = 2;
((C)tab[2]).c = 3;
}
}
abstract class A {
int a;
}
class B extends A {
int b;
}
class C extends A {
final double c = 1;
}
abstract class D extends A {
double d;
int operation(int a) {
return (a * 2);
}
abstract int calcul(int b) {
}
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