Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Call method on parent object

Posted on 2003-12-07
3
Medium Priority
?
329 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

604 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