Java - Error en compilacion en la clase teller

   
Vista:

Error en compilacion en la clase teller

Publicado por erickson luis (1 intervención) el 11/04/2010 19:36:56
public class Account
{
private char acctType;
private double balance;
private String acctId;

public char getAcctType()
{
return acctType;
}
public double getBalance()
{
return balance;
}
public String getId()
{
return acctId;
}
public void setBalance(double amount)
{
balance = amount;
}
public void setAcctId(String id)
{
acctId = id;
}
public void setAcctType(char type)
{
acctType = type;
}

}


public class Customer

{
private int custID;
private Account account;
private String firstName;
private String lastName;
private int numOfAccount;
private String cityName;
private String DOB;
private String emailAddress;
private String streetAddress;
private String phoneNumber;
private String zipOrPostalCode;


public String getAddress()
{
return streetAddress + cityName + zipOrPostalCode;
}
public Account getAccount()
{
return account;
}
public int getCustID()
{
return custID;
}
public String getEmail()
{
return emailAddress;
}
public String getName()
{
return lastName + "," + firstName;
}
public int getNumOfAccounts ()
{
return numOfAccount;
}
public String getPhone ()
{
return phoneNumber;
}
public String getDOB ()
{
return DOB;
}
public void setDOB (String birthDate)
{
DOB = birthDate;
}
public void setAddress (String street, String city, String postalCode)
{
streetAddress = street;
cityName = city;
zipOrPostalCode = postalCode;
}
public void setEmail (String email)
{
emailAddress = email;
}
public void setName (String lName, String fName)
{
lastName = lName;
firstName = fName;
}
public void setPhone(String phone)
{
phoneNumber = phone;
}
public void setAccount(Account acct)
{
account = acct;
}
}



public class Teller {

/**
* @param args
*/
public static void main(String[] args) {
//String a = "Rufino";
//String b = "Erickson";
Customer c1 = new Customer();
c1.setName("Rufino"," Erickson");
System.out.println("Customer names is " + c1.getName());
Account a1 = new Account();
a1.setBalance(1000.89);
c1.setAccount(a1);
System.out.println("Customer balance is " + a1.Account().getBalance());
}
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Error en compilacion en la clase teller

Publicado por Yamil Bracho (2072 intervenciones) el 12/04/2010 03:35:17
Cambia la linea
System.out.println("Customer balance is " + a1.Account().getBalance());
a
System.out.println("Customer balance is " + c1.getAccount().getBalance());
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar