Working with objects of different Classes

Reply

Join Date: Jul 2003
Posts: 117
Reputation: Iron_Cross is an unknown quantity at this point 
Solved Threads: 2
Iron_Cross's Avatar
Iron_Cross Iron_Cross is offline Offline
Junior Poster

Working with objects of different Classes

 
0
  #1
Mar 31st, 2004
Ok, this is an extremely stupid question, and I feel retarded for asking, considering how much I've been studying Java. But anyways, here goes.

Let's pretend I've created three classes, Class A, Class B, and Class C. Now in A I create an instance of Class B, let's call it AB. And I modify AB's variables, and invoke methods on it. Object AB holds valuable info, say for a database. Now in C I create another instance of Class B, I'll call it CB. From class C, is there any way I can specific information, such as instance vairable values and other such things of object AB (in class A)?

That's my quesiton. Thanks for any help
elitehackers.info
Today's Penny-Arcade!
Pain is weakness leaving the body!
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 8
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Working with objects of different Classes

 
0
  #2
Apr 1st, 2004
you can make an interface for this, or you can create accessor methods in AB and call those.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC