Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cas {
- public static void main(String[] args) {
- Father f = new Father();
- f.print();
- f = new Son();
- f.print();
- }
- }
- class Father {
- void print() {
- System.out.println("Father");
- }
- }
- class Son extends Father {
- void print() {
- System.out.println("Son");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement