Groovy Quiz 28 | Interface


Reference video | Groovy Playground


1 Point for every correct answer | Let’s Get Started

1.

An interface can have only abstract methods whereas

An abstract class can have both abstract and non-abstract (concrete) methods

non-abstract methods also have body

 

 
 

2.

To declare interface we use the keyword interface

e.g.

interface Car {   }

 

 
 

3.

To implement interface in a class the keyword is implements

 
 

5