Ben Hultin wrote:I am working on a program that needs to call in an element stored in four different objects. Obviously the element is not exactly the same or copies of an original, they each hold their own value. I am just stuck at a place where I am not sure how to call in all four elements from their appropriate object and then add them all together into one variable. I need this all to happen in the driven class if thats possible.
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ben Hultin wrote:thanks for the suggestions. This is getting more complex than I would prefer, considering static methods can only access static variables which are essentially constants, so I feel I am going to need to make this work some other way. Would it be easier to just put the method in the driver class?
Also how would you suggest I make references to the Hw1, Hw2, etc. objects in the driven class?
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ben Hultin wrote:thanks for the suggestions. This is getting more complex than I would prefer, considering static methods can only access static variables which are essentially constants...
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
We noticed he had no friends. So we gave him this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|