Solved

Call method on parent object

Posted on 2003-12-07
3
304 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now