This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IS-A confusion with practise exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IS-A confusion with practise exam question" Watch "IS-A confusion with practise exam question" New topic

IS-A confusion with practise exam question

Stephen Pengilley

Joined: Apr 06, 2013
Posts: 3
Hi all,

One of the questions in the practise program for exams asks whether the following statement is true

'is-a relationships always require at least two class types.'

I didn't think this was true but apparently I am wrong. The practise exam says that it is true!


interface foo {}

class bar implements foo {}

uses inheritance and passes is-a. But there is only one class type isn't there?

Would appreciate an explanation so I know which is true.

K. Tsang

Joined: Sep 13, 2007
Posts: 2985

What's your definition of a "class type"? Is an interface a class type?

So whether you say "class A extends B {}" or "class A implements B {}": A is a B.

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11858

I suppose there is a difference between a "class type" and a "class".

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Have you checked out Aspose?
subject: IS-A confusion with practise exam question
It's not a secret anymore!