mercredi 8 février 2017

IN THIS JAVA PROGRam its shows error .can anyone solve the error??and give the cause of the error?

Vote count: 0

class A

{

public void m1()

{

System.out.println("in m1");

}

}

class B extends A

{

public void m2()

{

System.out.println("in m2");

}

}

public class test

{

public static void main(String[] args) {
    {
        A a1= (A)new B();
        a1.m1();
        a1.m2();
        }

}

}

asked 57 secs ago

Let's block ads! (Why?)



IN THIS JAVA PROGRam its shows error .can anyone solve the error??and give the cause of the error?

Aucun commentaire:

Enregistrer un commentaire