mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-26 03:51:12 +07:00
17 lines
312 B
Plaintext
17 lines
312 B
Plaintext
|
|
class Cat {}
|
|
class DomesticCat extends Cat {}
|
|
|
|
class Test {
|
|
public static void main(String[] args) {
|
|
petCat((Cat) new DomesticCat());
|
|
}
|
|
|
|
static void petCat(Cat cat) {
|
|
System.out.println("A Cat");
|
|
}
|
|
|
|
static void petCat(DomesticCat domesticCat) {
|
|
System.out.println("A DomesticCat");
|
|
}
|
|
} |