Solved

Call method on parent object

Posted on 2003-12-07
3
317 Views
Last Modified: 2010-03-31
I am having trouble calling a method on the parent object.

Right now, I have a class "DEM" that creates an instance of class "Decomposer"  The Decomposer object needs to call a method on DEM, so I call call the constructor from DEM like this:

  Decomposer d = new Decomposer(this);

on Decomposer, the constructor stores a reference to the parent

  private DEM Parent;
  public Decomposer(DEM parentRef){
    Parent = parentRef;
  }

when I try to call a method on the object Parent,
  ArrayList r = (ArrayList) Parent.executeGddQuery(lstrGetFragsSQL);

note: executeGddQuery is a public function on DEM (public List executeGddQuery(String query))

I get a compile error:
  csis532\dem\Decomposer.java:176: cannot resolve symbol
  symbol  : method executeGddQuery (java.lang.String)
  location: interface ddbms.DEM
               ArrayList r = (ArrayList) Parent.executeGddQuery(lstrGetFragsSQL);


Can someone help me to work out calling the parent object's method?

Thanks,
Mike
0
Comment
Question by:mike_k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9893231
The method appears it is not defined in the DEM interface
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 9893234
>  private DEM Parent;

thange this to the actual class of the parent, or add the method to the DEM interface
0
 
LVL 92

Expert Comment

by:objects
ID: 9893334
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse console opening separately 2 38
ejb entity bean example issue 2 27
collection output issue 9 64
Eclipse for Java EE development 2 44
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question