Hello. Im new to Java. I don't know much about Java's codes but I have a good background in C. Im using NetBeans 6.7.
I have this code:
package javaapplication1;
public class Main {
public int x = 3;
public int test(){
x += 4;
return x;
}
public static void main(String[] args) {
test x = new test();
System.out.print("Hello World" + x.test);
}
}
I want to do an operation of integer x from another object then print it in Main. I can't get the code to run. The compiler is underlining the two "test" in statement "test x = new test();"