Fichas
Interfaces
Fichas del conjunto (13)
- 1What is an interface?A group of related methods with empty bodies
- 2Implementing an interface allows a class to become more _____ about the behaviour it promises to provideformal
- 3Interfaces form a _____ between a class and the outside world which enforced at build time by the compiler.contract
- 4If your class claims to implement an interface, all methods defined by that interface _____ appear in its source code before the class will successfully compile.MUST
- 5How is an interface similar to a class? (4)- Contain any number of methods
- has a .java extension
- bytecode appears in a .class file
- they are stored in packages - 6How does an interface differ from a class?- You CANNOT INSTANTIATE an interface
- No constructor
- All methods are abstract
- CANNOT contain instance fields
- It is IMPLEMENTED, not extended
- An interface can extend multiple interfaces - 7An interface is _____ abstractimplicitly
- 8Methods in an interface are implicitly _____public
- 9If a class doesn't perform all the behaviour of the interface, the class must declare itself _____abstract
- 10What comes first, extends or implements?extends
- 11The signature of the interface method and the same return type should be _____ when overriding methodsmaintained
- 12What are the 2 rules of implementing an interface?- A class can implement more than 1 interface at a time
- An interface can extend another interface - 13To extend multiple interface how would you do this (the 2 you wish to extend are sports and names)public interface Nathan extends Sports, Names;
Información
- Descripción
- Masters Programming I Fichas sobre Interfaces, creado por nhunsdale02 el 06/06/2014.
- Creado por
- nhunsdale02
- Visitas
- 16
- Valoración