Checking subclass declarations

A developer has written these supporting Java declarations:


Java
class Service { }
class Audit { }
final class Receipt { }


Consider each candidate below independently. Each candidate is added separately to the supporting declarations in the same source file. Enter yes if it compiles or no if it does not.


Java
class Courier extends Service { }


Java
class SecureReceipt extends Receipt { }


Java
class Combined extends Service, Audit { }


Java
class Recursive extends Recursive { }
Candidate classCompiles: yes or no
Courier
SecureReceipt
Combined
Recursive

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Inheritance Questions: