Search This Blog

Wednesday, 18 September 2013

shows the proper way to declare a class variable in java

public class MainClass
{
    static String helloMessage;

    public static void main(String[] args)
    {
        helloMessage = "Hello, World!";
        System.out.println(helloMessage);
    }
}

No comments:

Post a Comment