Hi I am having problems running and compiling a program with more than one class, but I am not sure how to do it in netbean, it keeps complaining. I have the 2 following files called respectively Account.java
public class Account {
String name;
String address;
double balance;
}
and UseAccount.java
import static java.lang.System.out;
class UseAccount {
public static void main(String args[]) {
Account myAccount;
Account yourAccount;
myAccount = new Account();
yourAccount = new Account();
myAccount.name = "Barry Burd";
myAccount.address = "222 Cyberspace Lane";
myAccount.balance = 24.02;
yourAccount.name = "Jane Q. Public";
yourAccount.address = "111 Consumer Street";
yourAccount.balance = 55.63;
out.print(myAccount.name);
out.print(" (");
out.print(myAccount.address);
out.print(") has $");
out.print(myAccount.balance);
out.println();
out.print(yourAccount.name);
out.print(" (");
out.print(yourAccount.address);
out.print(") has $");
out.print(yourAccount.balance);
}
}
With simple programs - one class only - I usually go FIle, New Project, select Java under categories and java application under Project, that's all. SO, in the case above I would have UseAccount.java as main class but then I don't know where to put the second one.
thanks