Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: New Help with 2 Lines of Code! - August 06, 1998 at 14:38:28

You are here: irt.org | BBS | New Help with 2 Lines of Code! [This BBS is closed]

Posted by Metin on August 06, 1998 at 14:38:28:

class test
{
String k = new String ();
public static void main (String args[])
{

k = "Hello World";
System.out.println (k);

}
}

What is wrong when I try to change the value of a global variable
"k". The compiler tells me that I cannot reference member "k"
without an object.

Am I not creating a new object when I say "new String ()"?

Thank You for any suggestions.
Follow-ups:

You are here: irt.org | BBS | New Help with 2 Lines of Code! [This BBS is closed]

©2018 Martin Webb