<code><font size=2 face="Courier New"><font color="#0066CC"><b>abstract </b></font><font color="#FF0000"><b>class </b></font><font color="#0066CC"><b>Parent</b></font><b>{
</b><font color="#0066CC"><b>abstract </b></font><font color="#800000"><b>void </b></font><font color="#0066CC"><b>mother</b></font><b>();
</b><font color="#0066CC"><b>abstract </b></font><font color="#800000"><b>void </b></font><font color="#0066CC"><b>father</b></font><b>();
}
</b><font color="#FF0000"><b>class </b></font><font color="#0066CC"><b>Child extends Parent</b></font><b>{
</b><font color="#800000"><b>void </b></font><font color="#0066CC"><b>mother</b></font><b>(){
</b><font color="#0066CC"><b>System</b></font><b>.</b><font color="#0066CC"><b>out</b></font><b>.</b><font color="#0066CC"><b>println</b></font><b>("I am Your Mother");
}
</b><font color="#800000"><b>void </b></font><font color="#0066CC"><b>father</b></font><b>(){
</b><font color="#0066CC"><b>System</b></font><b>.</b><font color="#0066CC"><b>out</b></font><b>.</b><font color="#0066CC"><b>println</b></font><b>("I am Your father");
}
</b><font color="#FF0000"><b>public </b></font><font color="#800000"><b>static void </b></font><font color="#0066CC"><b>main</b></font><b>(</b><font color="#0066CC"><b>String args</b></font><b>[]){
</b><font color="#0066CC"><b>Parent obj1 </b></font><b>= </b><font color="#FF0000"><b>new </b></font><font color="#0066CC"><b>Child</b></font><b>();
</b><font color="#0066CC"><b>obj1</b></font><b>.</b><font color="#0066CC"><b>mother</b></font><b>();
</b><font color="#0066CC"><b>Parent obj2 </b></font><b>= </b><font color="#FF0000"><b>new </b></font><font color="#0066CC"><b>Child</b></font><b>();
</b><font color="#0066CC"><b>obj1</b></font><b>.</b><font color="#0066CC"><b>father</b></font><b>();
}
}
</b></font>
</code>
I am Your Mother
I am Your father
Press any key to continue . . .
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.