mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
18 lines
330 B
Java
18 lines
330 B
Java
|
|
class Cat {}
|
|
class DomesticCat extends Cat {}
|
|
|
|
class Test {
|
|
public static void main(String[] args) {
|
|
Cat c<caret>at = new DomesticCat();
|
|
petCat(cat);
|
|
}
|
|
|
|
static void petCat(Cat cat) {
|
|
System.out.println("A Cat");
|
|
}
|
|
|
|
static void petCat(DomesticCat domesticCat) {
|
|
System.out.println("A DomesticCat");
|
|
}
|
|
} |