Suppose module puppy depends on module dog and module dog depends on module animal. Fill in the blank so that code in module dog can access the animal.behavior package in module animal.module animal { ___________ animal.behavior;}
A: export
B: exports
C: requires
D: requires transitive
A: export
B: exports
C: requires
D: requires transitive
举一反三
- class Animal { public Animal() { System.out.println("Animal!"); } } public class Dog extends Animal{ public Dog() { System.out.println("Dog!"); } public static void main(String[] args) { Dog dog=new Dog(); } }
- 下列各种java类的定义,那种是错误的 A: class Animal{}class Dog extends Animal {} B: final class Animal{}class Dog extends Animal{} C: abstract class Animal{}class Dog extends Animal{} D: public class Animal{}class Dog extends Animal{}
- Animal 是抽象类 ,Dog类和Cat类继承了Animal 。Animal dog = new Dog();的写法是否正确?
- 若Animal是Cat,Dog的父类,则下列选项中,正确的是() A: Animal animal = new Cat(); B: Cat cat = (Cat)new Animal(); C: Animal animal = new Dog(); D: Cat cat = (Cat)new Dog();
- 若Animal是Cat,Dog的父类,则下列选项中,正确的是() A: Animal animal = new Cat(); B: Animal a = new Cat(); Cat cat = (Cat) a; C: Animal animal = new Dog(); D: Cat cat = (Cat)new Dog();