Module 6 quiz: Interfaces

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following statements correctly specifies three interfaces? a) public class ClassA implements Interface1, Interface2, Interface3 b) public class ClassA implements [Interface1, Interface2, Interface3] c)public class ClassA implements (Interface1, Interface2, Interface3) d)public class ClassA implements Interface1 Interface2 Interface3

a

What is required for an interface method that has a body? a)The method header must begin with the key word default. b)A class that implements the interface must override the method. c)The @Default annotation must precede the method header. d) all of the above

d

a functional interface is simply an interface that has one abstract method

True

All fields declared in an interface

are final and static

An interface reference can refer to any object of any class that implements the interface

True

This annotation tells the Java compiler that a method is meant to override a method in the superclasss

@Override

If two methods in the same class have the same name but different signatures, the second overrides the first.

false

All methods in an abstract class must also be declared abstract

false, because the compiler already knows that the methods inside of it are abstract.

In an interface all methods have

public access


Conjuntos de estudio relacionados

Chapter 23 Assessing the Abdomen

View Set

Physiology Chapter 4 CELL MEMBRANE TRANSPORT

View Set

accounting end of semester assesment

View Set

CA Real Estate Practices Chapter 2

View Set

EAQ Chp 42 Electrolyte and Nursing Process

View Set