Professional Documents
Culture Documents
class Customer {
private int customerld;
private long telephoneNo;
public void setCustomerld(int id} {
customerld = id;
}
public void setTelephoneNo(long teleNo) {
telephoneNo=teleNo;
}
public int getCustomerld() {
return customerld;
}
public long getTelephoneNo() {
return telephoneNo;
}
class Retail {
Note how an
object of
Customer class is
created
Methods of a class
are accessed and
invoked using '.'
(dot) operator
custObj.setTelephoneNo(9201861311L);
System.out.println(Customer ld:+ custObj.getCustomerld());
System.out.printin(Telephone No:+
custObj.getTelephoneNo());
}
}
Discount
%
10
5
What is needed
to implement
this scenario?