File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IS-A confusion with practise exam question

 
Stephen Pengilley
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

However,

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.

Regards
Stephen
 
K. Tsang
Bartender
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 12020
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose there is a difference between a "class type" and a "class".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic