1

We have 2 JAVA classes related to a project, call them AGraph and CallGraph. We also have an interface named Graphism which is implemented by AGraph. There's one abstract class we have, named GraphSnippet, which basically creates a visualization of a ZEST graph.

Now, we want CallGraph to extend AGraph. My silly doubt here is, does CallGraph need to implement the interface Graphism as well?

Next, instead of making GraphSnippet an instance of the Graph class (Graph is a pre-defined class in the ZEST package), we want it to be an instance of CallGraph so that the functionalities of CallGraph and AGraph become a part of the implementation. And because we'll need the class AGraph during the later stages, we can't really knock this class out and get all its methods implemented in CallGraph.

Could someone help us with how to start with it? It's difficult for us, novice JAVA programmers, to figure out a way?

PS: We're working on Eclipse-JUNO.

Anirudh Sharma
  • 115
  • 3
  • 15
  • wait, you said that AGraph implements Graphism in the 1st paragraph. What do you mean by your *silly doubt*? – Sujay Nov 05 '12 at 09:14
  • You should try to clarify your question; talk about interfaces and classes only, not object. In particular `GraphSnippet an object of the Graph` makes no sense. – Cory Kendall Nov 05 '12 at 09:14
  • Your first two questions doesn't strike well. First your `AGraph` already implements `Graphism`, so what's the point? Secondly, we don't see any `Graph` class, of which you want `GraphSnippet` to be an object of. Please take a look at your question once again. – Rohit Jain Nov 05 '12 at 09:14
  • @Sujay, sorry for the typo. I corrected the statement. – Anirudh Sharma Nov 05 '12 at 09:17
  • @Rohit Jain, when I said Graph class, I meant the predefined Graph class that's a part of the ZEST package. – Anirudh Sharma Nov 05 '12 at 09:18

1 Answers1

5

Now, we want CallGraph to extend AGraph. My silly doubt here is, does CallGraph need to implement the interface Graphism as well?

Yes, but you won't have to do anything. Because it extends from AGraph, it will already implement Graphism. You won't have to mark this anywhere in your code.

Rohit Jain
  • 209,639
  • 45
  • 409
  • 525
Cory Kendall
  • 7,195
  • 8
  • 37
  • 64