public static void m3(Person p) { if (p instanceof Students) { ((Students) p).showDiag(); } if (p instanceof Employee) { ((Employee) p).showDiag(); } }