Solved

Call method on parent object

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing to a specific printer tray (HP 806dn printer) 3 83
Python Assistance 7 73
Eclipse IDE - Cannot copy/paste from console output 8 127
custom annotations 9 32
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

920 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