build and compile
I am new to java and am having trouble with setting things up so my code will compile.
I have 2 code programs (OSX) : JJ Edit (very bare-bones) and Net Beans.
I think with the JJEdit, I have to have all my classes in the same document, and with NetBeans I have to have all my classes in the same project, but in different documents.
Here is some code from the book I am learning with. The Echo class is at the bottom outside of the EchoTestDrive. I've tried putting it several different places.
Thanks for your help.
public class EchoTestDrive {
public static void main (String [] args) {
Echo e1 = new Echo;
Echo e2 = new Echo;
int x = 0;
while (x<4) {
e1.hello();
e1.count=e1.count + 1;
if (x==3) {
e2.count = e2.count + 1;
}
if (x>0) {
e2.count = e2.count + e1.count;
}
x=x+1;
}
System.out.println(e2.count);
}
}
class Echo {
int count = 0;
void hello() {
System.out.println("hello");
}
}

