This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 2231

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.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11153

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
It is sorta covered in the JavaRanch Style Guide.
subject: IS-A confusion with practise exam question
Similar Threads
Objective 7.6 Java Operators (instanceof) Operator
Passed with 89%
problem in "instanceof" operator and "searching(regex)"
page 159 of Sierra/Bates book