#Reference to objects

6 messages · Page 1 of 1 (latest)

cinder forge
#

For a uni exercise, I am trying to build a navigation system for a mars rover, for which I am using Eclipse.
My problem is that I don't know how to reference an instanced object outside of the main method, when I try to reference one of the objects it says "[Object name] cannot be resolved" and in the line where I instanced the object it says "the value of the local variable [object name] is not used". Can I only refer to static methods outside the main method?

wanton flumeBOT
#

This post has been reserved for your question.

Hey @cinder forge! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

oblique tendon
#

Yes, you’ll have to make a new instance of that class before accessing non static methods

cinder forge
#

So I'll have to make a new instance of Main and then run the program from there?

cinder forge
#

For reference: I the problem occurs when I try to refer to an object method from within a different, instanced object