compilation error while calling static method from another class

Hi,

I am new to Java Programming. I have written two class files Dummy1 and Dummy2.java in the same package Test.

In Dummy1.java I have declared a static final variable and a static method as you can see it below.

package Test;

import java.io.*;

public class Dummy1

{

public static final int var1= 10;

public static int varDisp(int var2)

{

return(var1+var2);

}

}

This is program is compiling fine.

I have called the static method varDisp from the class Dummy2 and it is as follows

package Test;

import java.io.*;

public class Dummy2

{

public int var3=15;

public int test=0;

test+=Dummy1.varDisp(var3);

}

and when i compile Dummy2.java, there is a compilation error <identifier > expected.

Please help me in this program.

[886 byte] By [koneru-123a] at [2007-11-26 12:45:57]
# 1
> public class Dummy2> {> public int var3=15;> public int test=0;> test+=Dummy1.varDisp(var3);> > }test+=Dummy1.varDisplay(var3);must be in a method, it cannot just be out somewhere in the class!
FortisVenalitera at 2007-7-7 16:25:32 > top of Java-index,Java Essentials,New To Java...
# 2
I have tried calling the static method from a method even then I am facing compilation error. cannot resolve symbolsymbol : variable Dummy1location:test +=Dummy1.varDisp(var3);^
koneru-123a at 2007-7-7 16:25:32 > top of Java-index,Java Essentials,New To Java...