Re: Convert String to Object - Newbie Question



This error likely has nothing to do with converting a String[] into an
Object.

oh! (i'm relieved and apprehensive at the same time. :p) I've been
humbled last night in my search of converting a string to Object,
wow. I'll take your advice and stick to the more elementary stuff
until I'm comfortable with Java.

Getting back to the actual problem: "non-static method setData....cannot
be referenced from a static content.", the Java compile is complaining
about the line

Node.setData(dataString);

Because setData is a non-static method, you need to invoke the method
on a Node object (or an object that has Node as an ancestor class). In
the code that you have given there are no Node objects. In the
epression

Node.setData(dataString);

"Node" is the name of a class, not a reference to a Node object (an
instance of the class). Where it the Node object whose data you want to

I see! Ok, well, now that you ask, there is no Node object whose data
I want to change. I now have something to work with to progress in my
program. (going to create an object, then perform that method on it
and see what happens..oh boy i'm excited now.)

Onward with my learning experience with Java. I cannot thank you guys
enough confirming and/or correcting my understanding about objects, in
particular.

-t






.



Relevant Pages

  • Re: Treeview help
    ... > Mike, thank you, ... In VB6's Treeview, there's only one Nodes collection, a reference to ... which is obtained from the Nodes property of the Treeview control itself. ... LastSibling, Next, Previous, Parent, and Root properties of a Node object. ...
    (microsoft.public.vb.general.discussion)
  • Re: How does a nested class reference its containing class.
    ... > I need some quick advice. ... > I just need to reference a containing class from the nested class. ... That's because the Java idea of an inner class with an implicit ... static nested classes in Java. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Treeview help
    ... the first argument is a reference to the parent. ... I didn't know you could pass a reference to a Node object for the first ... What matters most is writing clear and concise code. ...
    (microsoft.public.vb.general.discussion)
  • Re: Treeview help
    ... the first argument is a reference to the parent. ... I wonder.....would a reference to a Node object ... > think passing a Node object is a good idea. ... I can't see the control determining that it has the reference ...
    (microsoft.public.vb.general.discussion)
  • Re: the garbage collector
    ... Skybuck Flying wrote: ... Linked lists are still possible. ... Each node object would hold a reference ...
    (alt.comp.lang.borland-delphi)