Can't access public non-static class attribute from secondary class
<p>I have the following two classes:</p>

<pre><code>public class Class1
{
    public Class1 randomvariable; // Variable declared

    public static void main(String[] args)
    {
        randomvariable = new Class1(); // Variable initialized
    }
}

public class Class2
{
    public static void ranMethod()
    {
        randomvariable.getSomething(); // I can't access the member "randomvariable" here even though it's public and it's in the same project?
    }
}
</code></pre>

<p>I am very certain that it's a very fundamental thing I'm missing here, but what am I actually missing? The Class1 member "randomvariable" is public and so is the class and both classes are in the same project.
What do I have to do to fix this problem?</p>
