I'm supposed to make two java programs that are related, Account.java
public class Account {
// Declarations
String Number = "null";
String Type = "null";
String Card = "null";
String Date = "null";
protected Account() {
}
public String toString() {
return "\n\t Your account number is " + Number + ",your account type is " + Type + ",your card number is " + Card
+ ".\n\t your expireation date is: " + Date;
}
protected String getNumber() {
return Number;
}
protected void setNumber(String number) {
this.Number = number;
}
protected String getType() {
return Type;
}
protected void setType(String type) {
this.Type = type;
}
protected String getCard() {
return Card;
}
protected void setCard(String card) {
this.Card = card;
}
protected String getDate() {
return Date;
}
protected void setDate(String date) {
this.Date = date;
} }
and AccountTester.java
import java.util.Scanner;
public class AccountTester {
public static void main(String[] args) {
// Create Objects
Scanner s = new Scanner(System.in);
Account a = new Account();
// auto with nothing set
System.out.print("Your account information is curently set to" + a
+ "\n\n");
// set info for account
System.out.print("Please, enter your account number: \t");
a.setNumber(s.nextLine());
System.out.print("Please, enter your account type: \t");
a.setType(s.nextLine());
System.out.print("Please, enter your card number: \t");
a.setCard(s.nextLine());
System.out.print("Please, enter your expire date: \t");
a.setDate(s.nextLine());
System.out.print(a);
} }
The first code has no problems, but in the 2nd code in the line that says
"Account a = new Account();"
it shows an error saying "cannot find symbol, symbol class Account, location class accountTester". I tried changing it to
"AccountTester a = new Account();"
But it not only did it not fix it, but it also made all the codes with "a.set" give out the same "cannot find symbol" error. How can I fix this