Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 10th, 2004, 11:53 AM
Logwad Logwad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 17 Logwad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help with objects visible to program.

I was wondering if there was some way to store the name of objects that are created in a class into a variable of some sort and then use that variable to call methods in another class.

For example I am making a T.V. / remote program and it has three classes

main: which sets up and runs the program
remote: which is for a remote object
television: which is for a television object

I want to create a television and remote object with the main class, and then allow the main class to tell the remote object what the name of the television object is, so it can dynamically use whatever name is given to call methods of the TV object to change its variables ei:channel, volume.

If something isn't clear, please say so and I will try to clarify.

Thanks.

Reply With Quote
  #2  
Old May 10th, 2004, 08:56 PM
Logwad Logwad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 17 Logwad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To clarify the question, I have main class create a television object, I want to be able to call it anything I like.

Then I want the main class the tell the remote object what the name of the television object I just created so it can all its methods.

I guessing It will have something to do with arrayList, but i am not sure if or how it would be.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > help with objects visible to program.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT