Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Exercice3{
- public static void main(String[] args) {
- A x = new A();
- B y = new B();
- C z = new C();
- y.b = 2;
- z.c = 3;
- }
- abstract class A{
- int a;
- }
- class B extends A{
- int b;
- public B(int b){
- this.b= 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 void afficher();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment