class A { }
class MainClass extends A {
publicstaticvoid main (String [] args) {
A myA = new MainClass();
m2(myA);
}
publicstaticvoid m2(A a) {
if (a instanceof MainClass)
((MainClass)a).doBstuff();
}
publicstaticvoid doBstuff() {
System.out.println("'a'");
}
}